rossi.fstools.fs.fatfs
Class VFatDirEntry

java.lang.Object
  extended byrossi.fstools.fs.fatfs.VFatDirEntry
All Implemented Interfaces:
DiskStructure

public class VFatDirEntry
extends java.lang.Object
implements DiskStructure

Representation of a VFAT directory entry. This is where long filenames are stored.

  On disk the superblock looks like this:

        31        24        16       8       0
        --------------------------------------
  0000  |  Seq     |      Name               |
        --------------------------------------
  0004  |           Name                     |
        --------------------------------------
  0008  |           Name            |Attr    |
        --------------------------------------
  000C  | Resrvd| Hash     |   Name          |
        --------------------------------------
  0010  |           Name                     |
        --------------------------------------
  0014  |           Name                     |
        --------------------------------------
  0018  |    Name          |   Start         |
        --------------------------------------
  001C  |           Name                     |
        --------------------------------------

 


Field Summary
protected  byte attr
          Attributes.
protected  byte hashValue
          Hash value of the FatDirEntry this is associated with.
protected  java.lang.String name
          A fragment of the long filename.
protected  byte sequence
          Sequence number.
protected  int start
          Starting cluster
 
Constructor Summary
VFatDirEntry()
          Default constructor.
 
Method Summary
 byte getAttr()
          Attribute byte.
 int getDataSize()
          Get the size in bytes of the structure.
 byte getHashValue()
          Hash value of the FatDirEntry this long filename vfat record is assocated with.
 java.lang.String getName()
          Fragment of the long name stored in this record.
 byte getSequence()
          Get the sequence number.
 int getStart()
          Starting cluster.
 void loadFromBuffer(byte[] buffer, int offset)
          Loads the object from a memory buffer
 void setAttr(byte aAttr)
           
 void setHashValue(byte aHashValue)
           
 void setName(java.lang.String aName)
           
 void setSequence(byte aSequence)
           
 void setStart(int aStart)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sequence

protected byte sequence
Sequence number. First part of long filename is numbered 1, the last part has bit 6 set.


name

protected java.lang.String name
A fragment of the long filename.


attr

protected byte attr
Attributes. Must be 0xf.


hashValue

protected byte hashValue
Hash value of the FatDirEntry this is associated with.


start

protected int start
Starting cluster

Constructor Detail

VFatDirEntry

public VFatDirEntry()
Default constructor.

Method Detail

getDataSize

public int getDataSize()
Description copied from interface: DiskStructure
Get the size in bytes of the structure. For variable length sturctures this may represent the minimum length rather than the actual length.

Specified by:
getDataSize in interface DiskStructure
Returns:
the size of the structure.

getSequence

public byte getSequence()
Get the sequence number. First part of long filename is numbered 1, the last part has bit 6 set.

Returns:
sequence number.

setSequence

public void setSequence(byte aSequence)

getName

public java.lang.String getName()
Fragment of the long name stored in this record.

Returns:
long name fragment.

setName

public void setName(java.lang.String aName)

getAttr

public byte getAttr()
Attribute byte. Must by 0xf.


setAttr

public void setAttr(byte aAttr)

getHashValue

public byte getHashValue()
Hash value of the FatDirEntry this long filename vfat record is assocated with.

Returns:
hash value.

setHashValue

public void setHashValue(byte aHashValue)

getStart

public int getStart()
Starting cluster. Not used.

Returns:
starting cluster.

setStart

public void setStart(int aStart)

loadFromBuffer

public void loadFromBuffer(byte[] buffer,
                           int offset)
                    throws FsException
Description copied from interface: DiskStructure
Loads the object from a memory buffer

Specified by:
loadFromBuffer in interface DiskStructure
Parameters:
buffer - a byte[] containing data to be read in populating the object
offset - a int indicating the offset within the buffer to start parsing.
Throws:
FsException - if a parse error occurs.