rossi.fstools.fs.reiserfs
Class StatDataItem

java.lang.Object
  extended byrossi.fstools.fs.reiserfs.Item
      extended byrossi.fstools.fs.reiserfs.StatDataItem
All Implemented Interfaces:
Inode
Direct Known Subclasses:
StatDataV1, StatDataV2

public abstract class StatDataItem
extends Item
implements Inode

StatDataItem holds statistics about the object it describes. It is a close analogy to the Inodes in other filesystems except it doesnt directly hold block pointers.


Field Summary
 
Fields inherited from class rossi.fstools.fs.reiserfs.Item
block, buffer, bufferOffset, header
 
Fields inherited from interface rossi.fstools.fs.Inode
BLOCKDEV_MODE, CHARDEV_MODE, DIRECTORY_MODE, FIFO_MODE, FILE_MODE, FILETYPE_MASK, SOCKET_MODE, SYMLINK_MODE
 
Constructor Summary
StatDataItem(byte[] buffer, int bufferOffset, LeafNode block, ItemHead header)
           
 
Method Summary
static StatDataItem create(byte[] buffer, int bufferOffset, LeafNode block, ItemHead header)
          Create the appropriate subclass for a StatDataItem on disk.
abstract  long getAccessTime()
          Get the time the data was last accessed.
abstract  long getBlocks()
           
abstract  long getChangedTime()
          Get the time this Inode metadata was last changed.
abstract  long getGroupId()
          Get the group id of the object's owner.
abstract  int getMode()
          Get the mode of the object.
abstract  long getModifyTime()
          Get the time the data was last modified.
abstract  long getNumLinks()
          Get the number of hard links to this file.
abstract  int getRDev()
          Get the device major/minor numbers.
abstract  long getSize()
          Get the size of the data associated with the object.
abstract  long getUserId()
          Get the user id of the object's owner.
abstract  void setAccessTime(long aAccessTime)
           
abstract  void setBlocks(long aBlocks)
           
abstract  void setChangedTime(long aChangedTime)
           
abstract  void setGroupId(long aGroupId)
           
abstract  void setMode(int aMode)
          Set the mode.
abstract  void setModifyTime(long aModifyTime)
           
abstract  void setNumLinks(long aNumLinks)
           
abstract  void setSize(long aSize)
           
abstract  void setUserId(long aUserId)
           
 java.lang.String toString()
           
 
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, wait, wait, wait
 

Constructor Detail

StatDataItem

public StatDataItem(byte[] buffer,
                    int bufferOffset,
                    LeafNode block,
                    ItemHead header)
             throws FsException
Method Detail

getMode

public abstract int getMode()
Description copied from interface: Inode
Get the mode of the object. The least significant 12 bits control the object's access permissions. The next 4 bits control the type of the object.

Specified by:
getMode in interface Inode
Returns:
the mode

setMode

public abstract void setMode(int aMode)
Description copied from interface: Inode
Set the mode.

Specified by:
setMode in interface Inode
Parameters:
aMode - the mode.
See Also:
Inode.getMode()

getNumLinks

public abstract long getNumLinks()
Description copied from interface: Inode
Get the number of hard links to this file. A value of zero indicates that the object is deleted. A hard link is a directory entry pointing directly at this object (not via symlinks).

Specified by:
getNumLinks in interface Inode
Returns:
the number of links

setNumLinks

public abstract void setNumLinks(long aNumLinks)
Specified by:
setNumLinks in interface Inode

getUserId

public abstract long getUserId()
Description copied from interface: Inode
Get the user id of the object's owner.

Specified by:
getUserId in interface Inode
Returns:
the user id

setUserId

public abstract void setUserId(long aUserId)
Specified by:
setUserId in interface Inode

getGroupId

public abstract long getGroupId()
Description copied from interface: Inode
Get the group id of the object's owner.

Specified by:
getGroupId in interface Inode
Returns:
the group id

setGroupId

public abstract void setGroupId(long aGroupId)
Specified by:
setGroupId in interface Inode

getSize

public abstract long getSize()
Description copied from interface: Inode
Get the size of the data associated with the object. This is mostly meaningful with normal files.

Specified by:
getSize in interface Inode
Returns:
the size

setSize

public abstract void setSize(long aSize)
Specified by:
setSize in interface Inode

getAccessTime

public abstract long getAccessTime()
Description copied from interface: Inode
Get the time the data was last accessed.

Specified by:
getAccessTime in interface Inode
Returns:
the access time.

setAccessTime

public abstract void setAccessTime(long aAccessTime)
Specified by:
setAccessTime in interface Inode

getModifyTime

public abstract long getModifyTime()
Description copied from interface: Inode
Get the time the data was last modified.

Specified by:
getModifyTime in interface Inode
Returns:
the access time.

setModifyTime

public abstract void setModifyTime(long aModifyTime)
Specified by:
setModifyTime in interface Inode

getChangedTime

public abstract long getChangedTime()
Description copied from interface: Inode
Get the time this Inode metadata was last changed.

Specified by:
getChangedTime in interface Inode
Returns:
long

setChangedTime

public abstract void setChangedTime(long aChangedTime)
Specified by:
setChangedTime in interface Inode

getBlocks

public abstract long getBlocks()

setBlocks

public abstract void setBlocks(long aBlocks)

getRDev

public abstract int getRDev()
Get the device major/minor numbers.


create

public static StatDataItem create(byte[] buffer,
                                  int bufferOffset,
                                  LeafNode block,
                                  ItemHead header)
                           throws FsException
Create the appropriate subclass for a StatDataItem on disk. Figure out if its V1 or V2 based on the item size.

Parameters:
buffer - a byte[] buffer holding the item
bufferOffset - a int offset into the buffer marking the start of the item
block - the LeafNode containing this item
header - the ItemHead for this item
Returns:
StatDataItem
Throws:
FsException

toString

public java.lang.String toString()