Class 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 via getFileSystem(). 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 calling FileSystem.getVolumeLabel().

    • 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, see BlockDeviceDriver.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 calling FileSystem.getVolumeLabel().
        Returns:
        Returns the volume label of this partition.