Class Fat32FileSystem
- java.lang.Object
-
- com.github.mjdev.libaums.fs.fat32.Fat32FileSystem
-
- All Implemented Interfaces:
FileSystem
public class Fat32FileSystem extends java.lang.Object implements FileSystem
This class represents the FAT32 file system and is responsible for setting the FAT32 file system up and extracting the volume label and the root directory.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCapacity()intgetChunkSize()longgetFreeSpace()ATTENTION: This value can be inaccurate, depending on actual file system and certain file system specific properties.longgetOccupiedSpace()ATTENTION: This value can be inaccurate, depending on actual file system and certain file system specific properties.UsbFilegetRootDirectory()This method returns the root directory of the file system.intgetType()java.lang.StringgetVolumeLabel()This method returns the name of the volume which is mostly saved in the file system.static Fat32FileSystemread(BlockDeviceDriver blockDevice)This method constructs a FAT32 file system for the given block device.
-
-
-
Method Detail
-
read
public static Fat32FileSystem read(BlockDeviceDriver blockDevice) throws java.io.IOException
This method constructs a FAT32 file system for the given block device. There are no further checks if the block device actually represents a valid FAT32 file system. That means it must be ensured that the device actually holds a FAT32 file system in advance!- Parameters:
blockDevice- The block device the FAT32 file system is located.- Throws:
java.io.IOException- If reading from the device fails.
-
getRootDirectory
public UsbFile getRootDirectory()
Description copied from interface:FileSystemThis method returns the root directory of the file system.- Specified by:
getRootDirectoryin interfaceFileSystem- Returns:
- The root directory of the file system.
-
getVolumeLabel
public java.lang.String getVolumeLabel()
Description copied from interface:FileSystemThis method returns the name of the volume which is mostly saved in the file system.In Windows the name of a volume is shown in the explorer before the drive letter.
- Specified by:
getVolumeLabelin interfaceFileSystem- Returns:
-
getCapacity
public long getCapacity()
- Specified by:
getCapacityin interfaceFileSystem- Returns:
- The total "capacity" of the file system in bytes.
-
getOccupiedSpace
public long getOccupiedSpace()
Description copied from interface:FileSystemATTENTION: This value can be inaccurate, depending on actual file system and certain file system specific properties. Use as an estimation.- Specified by:
getOccupiedSpacein interfaceFileSystem- Returns:
- Occupied space in the file system in bytes (estimate).
-
getFreeSpace
public long getFreeSpace()
Description copied from interface:FileSystemATTENTION: This value can be inaccurate, depending on actual file system and certain file system specific properties. Use as an estimation.- Specified by:
getFreeSpacein interfaceFileSystem- Returns:
- Free space in the file system in bytes (estimate).
-
getChunkSize
public int getChunkSize()
- Specified by:
getChunkSizein interfaceFileSystem- Returns:
- returns the optimal chuck size in bytes (you should read and write in multiples of that)
-
getType
public int getType()
- Specified by:
getTypein interfaceFileSystem- Returns:
- file system type
PartitionTypes
-
-