Class Partition
- java.lang.Object
-
- com.github.mjdev.libaums.driver.ByteBlockDevice
-
- com.github.mjdev.libaums.partition.Partition
-
- All Implemented Interfaces:
BlockDeviceDriver
public class Partition extends ByteBlockDevice
This class represents a partition on an mass storage device. A partition has a certain file system which can be accessed viagetFileSystem(). This file system is needed to to access the files and directories of a partition.The method
getVolumeLabel()returns the volume label for the partition. Calling the method is equivalent to callingFileSystem.getVolumeLabel().
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PartitioncreatePartition(PartitionTableEntry entry, BlockDeviceDriver blockDevice)Creates a new partition with the information given.FileSystemgetFileSystem()java.lang.StringgetVolumeLabel()This method returns the volume label of the file system / partition.-
Methods inherited from class com.github.mjdev.libaums.driver.ByteBlockDevice
getBlockSize, init, read, write
-
-
-
-
Method Detail
-
createPartition
public static Partition createPartition(PartitionTableEntry entry, BlockDeviceDriver blockDevice) throws java.io.IOException
Creates a new partition with the information given.- Parameters:
entry- The entry the partition shall represent.blockDevice- The underlying block device. This block device must already been initialized, seeBlockDeviceDriver.init().- Returns:
- The newly created Partition.
- Throws:
java.io.IOException- If reading from the device fails.
-
getFileSystem
public FileSystem getFileSystem()
- Returns:
- the file system on the partition which can be used to access files and directories.
-
getVolumeLabel
public java.lang.String getVolumeLabel()
This method returns the volume label of the file system / partition. Calling this method is equivalent to callingFileSystem.getVolumeLabel().- Returns:
- Returns the volume label of this partition.
-
-