public class Inode
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.nio.ByteBuffer |
buffer |
private int |
i_atime |
private int[] |
i_block_pointer |
private int |
i_ctime |
private int |
i_dtime |
private short |
i_gid |
private short |
i_links_count |
private short |
i_mode |
private int |
i_mtime |
private int |
i_size_lower |
private int |
i_size_upper |
private short |
i_uid |
| Constructor and Description |
|---|
Inode(byte[] bytes)
Constructor of the inode class
|
| Modifier and Type | Method and Description |
|---|---|
private static int |
findInodeOffset(java.lang.String path,
Inode inode,
Ext2File ext2)
This class calculates the inode number, needed to readBytes the data contained in the block that the inode points to
If there was no match, method returns integer 0
|
(package private) int[] |
getBlockPointers() |
(package private) static int |
getContainingBlock(int rootInodeOffset,
Superblock superblock,
GroupDescriptor groupDescriptor)
A static method, used for fetching the block number (offset), that an inode points to.
|
(package private) static Inode |
getContainingInode(java.lang.String[] pathArray,
int inodeSize,
Ext2File ext2,
Inode inode,
Superblock superblock,
GroupDescriptor groupDescriptor)
This method will get the number of the inode, if the names
in pathArray array match the names in the volume
If the inode number is 0, the program will be terminated.
|
java.util.Date |
getDate() |
(package private) java.lang.String |
getGid() |
(package private) short |
getHardLinks() |
(package private) int |
getSizeLower() |
(package private) int |
getSizeUpper() |
(package private) java.lang.String |
getUid() |
boolean |
isFile() |
private void |
read()
This method will readBytes all the data that is contained in the inode, from the buffer, in which the byte array was parsed
|
(package private) java.lang.String |
readPermissions()
This method uses bitwise ANDing on FileSystem's i_mode variable value,
to determine what permissions a directory or file has.
|
private short i_mode
private short i_uid
private int i_size_lower
private int i_atime
private int i_ctime
private int i_mtime
private int i_dtime
private short i_gid
private short i_links_count
private int[] i_block_pointer
private int i_size_upper
private java.nio.ByteBuffer buffer
public Inode(byte[] bytes)
bytes - is the byte array that contains the inode's dataprivate void read()
java.lang.String readPermissions()
private static int findInodeOffset(java.lang.String path,
Inode inode,
Ext2File ext2)
throws java.io.IOException
path - is the name of the directory or file to look forjava.io.IOException - estatic Inode getContainingInode(java.lang.String[] pathArray, int inodeSize, Ext2File ext2, Inode inode, Superblock superblock, GroupDescriptor groupDescriptor) throws java.io.IOException
pathArray - is the array of names of directories and files, that thejava.io.IOException - ioestatic int getContainingBlock(int rootInodeOffset,
Superblock superblock,
GroupDescriptor groupDescriptor)
rootInodeOffset - The number of the inode, with which this method will calculate the containing block numberint[] getBlockPointers()
java.lang.String getUid()
java.lang.String getGid()
int getSizeLower()
int getSizeUpper()
public boolean isFile()
public java.util.Date getDate()
short getHardLinks()