Class Directory

java.lang.Object
org.fedoraproject.xmvn.tools.install.File
org.fedoraproject.xmvn.tools.install.Directory

public class Directory extends File
A directory installed as part of a package.

While package doesn't have to own all directories it creates, directories represented by instances of this class are assumed to be owned by the package they belong to.

Author:
Mikolaj Izdebski
  • Constructor Details

    • Directory

      public Directory(Path targetPath)
      Create a directory with specified path and default permissions (0755).
      Parameters:
      targetPath - directory path, relative to installation root
    • Directory

      public Directory(Path targetPath, int accessMode)
      Create a directory with specified path and permissions.
      Parameters:
      targetPath - directory path, relative to installation root
      accessMode - Unix access mode of the file (must be an integer in range from 0 to 0777)
  • Method Details

    • installContents

      protected void installContents(Path targetAbsolutePath) throws IOException
      Description copied from class: File
      Install the file into specified location.

      Implementations of this method can assume that all parent directory of target file already exists. Access mode of target file doesn't have to be set as it will be manipulated with other means.

      Specified by:
      installContents in class File
      Parameters:
      targetAbsolutePath - absolute path to the target file
      Throws:
      IOException
    • getDescriptorExtra

      protected String getDescriptorExtra()
      Description copied from class: File
      Get additional file attributes to be added to file descriptor.

      By default there are no extra attributes, but subclasses can override this method and specify it.

      Overrides:
      getDescriptorExtra in class File
      Returns:
      extra descriptor data (can be null)