Class 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.

    • Constructor Summary

      Constructors 
      Constructor Description
      Directory​(java.nio.file.Path targetPath)
      Create a directory with specified path and default permissions (0755).
      Directory​(java.nio.file.Path targetPath, int accessMode)
      Create a directory with specified path and permissions.
    • Constructor Detail

      • Directory

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

        public Directory​(java.nio.file.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 Detail

      • installContents

        protected void installContents​(java.nio.file.Path targetAbsolutePath)
                                throws java.io.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:
        java.io.IOException
      • getDescriptorExtra

        protected java.lang.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)