public class FileInfo
extends java.lang.Object
| Constructor and Description |
|---|
FileInfo() |
| Modifier and Type | Method and Description |
|---|---|
private static void |
printBlockData(int blockNumber,
int inodeSize,
boolean isFile,
Ext2File ext2,
Superblock superblock,
GroupDescriptor groupDescriptor)
This method will print the data contained in a file or the metadata from the inode, if it is a Directory
|
private static void |
readBlockData(Inode inode,
boolean isFile,
int inodeSize,
Ext2File ext2,
Superblock superblock,
GroupDescriptor groupDescriptor)
This method will readBytes the block pointers values of an inode and if a pointer
points to real data, it will call the appropriate methods to print that data.
|
(package private) static void |
readDirectoryData(Inode inode,
int inodeSize,
Ext2File ext2,
Superblock superblock,
GroupDescriptor groupDescriptor)
This method will be used to display contents of a directory
|
private static void |
readDoubleIndirectData(int blockNumber,
int inodeSize,
boolean isFile,
Ext2File ext2,
Superblock superblock,
GroupDescriptor groupDescriptor)
This method will readBytes the double indirect data block and if data exists it will call readIndirectData()
|
(package private) static void |
readFileData(Inode inode,
int inodeSize,
Ext2File ext2,
Superblock superblock,
GroupDescriptor groupDescriptor,
java.lang.String path)
This method will be used to print the contents of a file
|
(package private) void |
readHexData(java.util.ArrayList<byte[]> raw)
This method will readBytes byte arrays from a list of byte arrays and print the content in a
readable Hexadecimal format, with 26 hex characters in each line for readability
|
private static void |
readIndirectData(int blockNumber,
int inodeSize,
boolean isFile,
Ext2File ext2,
Superblock superblock,
GroupDescriptor groupDescriptor)
This method will readBytes the indirect data block and if data exists it will call printBlockData()
|
private static void |
readTripleIndirectData(int blockNumber,
int inodeSize,
boolean isFile,
Ext2File ext2,
Superblock superblock,
GroupDescriptor groupDescriptor)
This method will readBytes the triple indirect data block and if data exists it will call readDoubleIndirectData()
|
void readHexData(java.util.ArrayList<byte[]> raw)
raw - is the ArrayList with bytes that this method will readBytes and print as hexstatic void readDirectoryData(Inode inode, int inodeSize, Ext2File ext2, Superblock superblock, GroupDescriptor groupDescriptor) throws java.io.IOException
inode - The inode of the given pathinodeSize - The size of the inodeext2 - The disksuperblock - The superblockgroupDescriptor - The group descriptorjava.io.IOException - If the disk can't be readstatic void readFileData(Inode inode, int inodeSize, Ext2File ext2, Superblock superblock, GroupDescriptor groupDescriptor, java.lang.String path) throws java.io.IOException
inode - The inode of the given pathinodeSize - The size of the inodeext2 - The disksuperblock - The superblockgroupDescriptor - The group descriptorpath - The path that was entered by the userjava.io.IOException - If the disk can't be readprivate static void readBlockData(Inode inode, boolean isFile, int inodeSize, Ext2File ext2, Superblock superblock, GroupDescriptor groupDescriptor) throws java.io.IOException
inode - is the Inode, whose block pointers will be readBytesjava.io.IOException - eprivate static void printBlockData(int blockNumber,
int inodeSize,
boolean isFile,
Ext2File ext2,
Superblock superblock,
GroupDescriptor groupDescriptor)
throws java.io.IOException
blockNumber - is the offset of the data, obtained by the direct pointers to data in the inode.java.io.IOException - eprivate static void readIndirectData(int blockNumber,
int inodeSize,
boolean isFile,
Ext2File ext2,
Superblock superblock,
GroupDescriptor groupDescriptor)
throws java.io.IOException
blockNumber - is the offset of the data, obtained by the block pointers from the inode.java.io.IOException - eprivate static void readDoubleIndirectData(int blockNumber,
int inodeSize,
boolean isFile,
Ext2File ext2,
Superblock superblock,
GroupDescriptor groupDescriptor)
throws java.io.IOException
blockNumber - is the offset of the data, obtained by the block pointers from the inode.java.io.IOException - eprivate static void readTripleIndirectData(int blockNumber,
int inodeSize,
boolean isFile,
Ext2File ext2,
Superblock superblock,
GroupDescriptor groupDescriptor)
throws java.io.IOException
blockNumber - is the offset of the data, obtained by the block pointers from the inode.java.io.IOException - e