Class FileLocation

    • Constructor Detail

      • FileLocation

        public FileLocation​(File file)
      • FileLocation

        public FileLocation​(String path)
      • FileLocation

        public FileLocation​(URI path)
    • Method Detail

      • getFile

        public File getFile()
        Gets the associated File.
      • getURI

        public URI getURI()
        Description copied from interface: Location
        Gets the location expressed as a URI, or null if the location cannot be expressed as such.
        Specified by:
        getURI in interface Location
      • getName

        public String getName()
        Description copied from interface: Location
        Gets a (typically short) name expressing this location. This string is not intended to unambiguously identify the location, but rather act as a friendly, human-readable name. The precise behavior will depend on the implementation, but as an example, a file-based location could return the name of the associated file without its full path.
        Specified by:
        getName in interface Location
        Returns:
        The name, or an empty string if no name is available.
      • parent

        public FileLocation parent()
                            throws IOException
        Description copied from interface: BrowsableLocation
        Obtains a location pointing to the parent directory of this one.
        Specified by:
        parent in interface BrowsableLocation
        Returns:
        the parent location of this one, or null if this location has no parent.
        Throws:
        IOException - if something goes wrong obtaining the parent.
      • sibling

        public FileLocation sibling​(String path)
        Description copied from interface: BrowsableLocation
        Obtains a location relative to this one, which will be configured like the current location, but point to a the file specified by the path parameter.
        Specified by:
        sibling in interface BrowsableLocation
        Parameters:
        path - the relative path of the desired location.
        Returns:
        A location that points to the specified file location.