Class GFileLocal

  • All Implemented Interfaces:
    GFile

    public class GFileLocal
    extends java.lang.Object
    implements GFile
    GFile implementation that refers to a real java.io.File on the local file system.

    This implementation keeps track of the FSRL and GFile path separately so that they can be different, as is the case with LocalFileSystemSub files that have real FSRLs but fake relative paths.

    • Constructor Detail

      • GFileLocal

        public GFileLocal​(java.io.File f,
                          java.lang.String path,
                          FSRL fsrl,
                          GFileSystem fs,
                          GFile parent)
        Create new GFileLocal instance.
        Parameters:
        f - File on the local filesystem
        path - String path (including filename) of this instance
        fsrl - FSRL of this instance
        fs - GFileSystem that created this file.
        parent - Parent directory that contains this file, or null if parent is root.
    • Method Detail

      • getFSRL

        public FSRL getFSRL()
        Description copied from interface: GFile
        The FSRL of this file.
        Specified by:
        getFSRL in interface GFile
        Returns:
        FSRL of this file.
      • getParentFile

        public GFile getParentFile()
        Description copied from interface: GFile
        The parent directory of this file.
        Specified by:
        getParentFile in interface GFile
        Returns:
        parent GFile directory of this file.
      • getPath

        public java.lang.String getPath()
        Description copied from interface: GFile
        The path and filename of this file, relative to its owning filesystem.
        Specified by:
        getPath in interface GFile
        Returns:
        path and filename of this file, relative to its owning filesystem.
      • getName

        public java.lang.String getName()
        Description copied from interface: GFile
        The name of this file.
        Specified by:
        getName in interface GFile
        Returns:
        name of this file.
      • isDirectory

        public boolean isDirectory()
        Description copied from interface: GFile
        Returns true if this is a directory.

        Specified by:
        isDirectory in interface GFile
        Returns:
        boolean true if this file is a directory, false otherwise.
      • getLength

        public long getLength()
        Description copied from interface: GFile
        Returns the length of this file, or -1 if not known.
        Specified by:
        getLength in interface GFile
        Returns:
        number of bytes in this file.
      • getLastModified

        public long getLastModified()
        Specified by:
        getLastModified in interface GFile
      • getLocalFile

        public java.io.File getLocalFile()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object