public class Directory extends Ext2File
Modifier and Type | Field and Description |
---|---|
int |
INODE_FIELD_SIZE |
int |
LENGTH_FIELD_OFFSET |
int |
LENGTH_FIELD_SIZE |
int |
NAME_FIELD_OFFSET |
int |
NAME_LENGTH_FIELD_OFFSET |
int |
NAME_LENGTH_FIELD_SIZE |
int |
TYPE_INDICATOR_FIELD_OFFSET |
int |
TYPE_INDICATOR_FIELD_SIZE |
BLOCK_SIZE
Constructor and Description |
---|
Directory(Block[] content,
boolean debug)
Constructor method.
|
Modifier and Type | Method and Description |
---|---|
int |
getFileNum(java.lang.String fileName)
Accessor function.
|
int |
getInodePointer(int fileNum)
Accessor function.
|
short |
getLength(int fileNum)
Accessor function.
|
java.lang.String |
getName(int fileNum)
Accessor function.
|
byte |
getNameLength(int fileNum)
Accessor function.
|
int |
getNumofFiles()
Accessor function.
|
char |
getType(int fileNum)
Accessor function.
|
byte |
getTypeIndicator(int fileNum)
Accessor function.
|
void |
listDir()
Prints the directory listing.
|
public final int INODE_FIELD_SIZE
public final int LENGTH_FIELD_SIZE
public final int NAME_LENGTH_FIELD_SIZE
public final int TYPE_INDICATOR_FIELD_SIZE
public final int LENGTH_FIELD_OFFSET
public final int NAME_LENGTH_FIELD_OFFSET
public final int TYPE_INDICATOR_FIELD_OFFSET
public final int NAME_FIELD_OFFSET
public Directory(Block[] content, boolean debug)
content
- The array of Blocks containing the file.debug
- Whether debug mode is active or not.public int getFileNum(java.lang.String fileName)
fileName
- The name of the file.public int getNumofFiles()
public int getInodePointer(int fileNum)
fileNum
- The index of the file.public short getLength(int fileNum)
fileNum
- The index of the file.public byte getNameLength(int fileNum)
fileNum
- The index of the file.public char getType(int fileNum)
fileNum
- The index of the file.public byte getTypeIndicator(int fileNum)
fileNum
- The index of the file.public java.lang.String getName(int fileNum)
fileNum
- The index of the file.public void listDir()