rossi.fstools.fs.reiserfs
Class DirectoryItem

java.lang.Object
  extended byrossi.fstools.fs.reiserfs.Item
      extended byrossi.fstools.fs.reiserfs.DirectoryItem

public class DirectoryItem
extends Item

Representation of a Directory.

An item is an abstract data holder within a block.

A directory has an array of directory entry items at the beginning, the names corresponding to those entries are packed in at the end of the item.


Field Summary
protected  DirEntry[] entries
           
 
Fields inherited from class rossi.fstools.fs.reiserfs.Item
block, buffer, bufferOffset, header
 
Constructor Summary
DirectoryItem(byte[] buffer, int bufferOffset, LeafNode block, ItemHead header)
          Create a new DirecotryItem and populate it from the supplied buffer.
 
Method Summary
 DirEntry[] getEntries()
          Get the directory entries themselves.
protected  void load()
          Parse the item and load the array of directory entries from the data with the item.
 int numEntries()
          Get the number of directory entries from the Item header.
 
Methods inherited from class rossi.fstools.fs.reiserfs.Item
getBlock, getBlockPointer, getBuffer, getBufferOffset, getHeader, getRawData, setBlock, setBuffer, setBufferOffset, setHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entries

protected DirEntry[] entries
Constructor Detail

DirectoryItem

public DirectoryItem(byte[] buffer,
                     int bufferOffset,
                     LeafNode block,
                     ItemHead header)
              throws FsException
Create a new DirecotryItem and populate it from the supplied buffer.

Parameters:
buffer - a byte[] containing the item data.
bufferOffset - a int containing the offset within the buffer of the beginning of the item.
block - The parent block containing this item.
header - an ItemHead -- The header for this item with the parent block.
Throws:
FsException
Method Detail

numEntries

public int numEntries()
Get the number of directory entries from the Item header.

Returns:
number of entries

getEntries

public DirEntry[] getEntries()
Get the directory entries themselves.

Returns:
array of directory entries

load

protected void load()
             throws FsException
Parse the item and load the array of directory entries from the data with the item.

Throws:
FsException