Interface FileSystemSupport

    • Method Detail

      • getChildren

        java.lang.Iterable<? extends Path> getChildren​(Path path)
        Parameters:
        path -
        Returns:
        the children of the folder the given path points to; empty iterable if the path points to a non existent file or folder
        Throws:
        java.lang.IllegalArgumentException - if it is not possible to get children of a given path for some reason
      • exists

        boolean exists​(Path path)
        Parameters:
        path - the path
        Returns:
        whether the given path points to an existent file.
      • isFolder

        boolean isFolder​(Path path)
        Parameters:
        path -
        Returns:
        whether the given path points to an existent folder
      • isFile

        boolean isFile​(Path path)
        Parameters:
        path -
        Returns:
        whether the given path points to an existent file
      • getLastModification

        long getLastModification​(Path path)
        Parameters:
        path -
        Returns:
        A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L if the file does not exist.
      • getCharset

        java.lang.String getCharset​(Path path)
        Returns the name of a charset to be used when decoding the contents of this file into characters.
        Parameters:
        path - the path
        Returns:
        the name of a charset
        Throws:
        java.lang.IllegalArgumentException - if it is not possible to get charset of a given path for some reason
      • getContents

        java.lang.CharSequence getContents​(Path path)
        Returns the contents of this file as a char sequence.
        Parameters:
        path - the path
        Returns:
        an input stream containing the contents of the file
        Throws:
        java.lang.IllegalArgumentException - if the path points to a non existent file
      • getContentsAsStream

        java.io.InputStream getContentsAsStream​(Path path)
        Returns an open input stream on the contents of this file.
        Parameters:
        path - the path
        Returns:
        an input stream containing the contents of the file
        Throws:
        java.lang.IllegalArgumentException - if the path points to a non existent file
      • toURI

        java.net.URI toURI​(Path path)

        Returns the URI representing the given path.

        Warning: Don't use this method to get write access.

        Parameters:
        path - the path
        Returns:
        the URI representing the given path or null if the path points to a non existent file or a folder.