Class GcMFile

    • Field Detail

      • directory

        public final File directory
      • name

        public final String name
      • lastModified

        public final long lastModified
      • length

        public final long length
      • index

        public final int index
    • Method Detail

      • getLastModified

        public long getLastModified()
        Description copied from interface: MFile
        Get time of last modification at the time the MFile object was created
        Specified by:
        getLastModified in interface MFile
        Returns:
        time of last modification in Unix time (msecs since reference), or -1 if unknown
      • getLength

        public long getLength()
        Description copied from interface: MFile
        Size of file in bytes
        Specified by:
        getLength in interface MFile
        Returns:
        Size of file in bytes or -1 if unknown
      • isDirectory

        public boolean isDirectory()
        Specified by:
        isDirectory in interface MFile
      • getPath

        public String getPath()
        Description copied from interface: MFile
        Get full path name, replace \\ with /
        Specified by:
        getPath in interface MFile
        Returns:
        full path name
      • getName

        public String getName()
        Description copied from interface: MFile
        The name is the farthest element from the root in the directory hierarchy.
        Specified by:
        getName in interface MFile
        Returns:
        the file name
      • getParent

        public MFile getParent()
        Description copied from interface: MFile
        Get the parent of this
        Specified by:
        getParent in interface MFile
        Returns:
        the parent or null
      • getDirectory

        public File getDirectory()
      • exists

        public boolean exists()
        Description copied from interface: MFile
        Check if the MFile exists
        Specified by:
        exists in interface MFile
        Returns:
        true if the MFile exists, else false
      • writeToStream

        public void writeToStream​(OutputStream outputStream)
                           throws IOException
        Description copied from interface: MFile
        Write the MFile to an OutputStream
        Specified by:
        writeToStream in interface MFile
        Parameters:
        outputStream - the OutputStream the MFile contents should be written to
        Throws:
        IOException
      • writeToStream

        public void writeToStream​(OutputStream outputStream,
                                  long offset,
                                  long maxBytes)
                           throws IOException
        Description copied from interface: MFile
        Write the MFile to an OutputStream
        Specified by:
        writeToStream in interface MFile
        Parameters:
        outputStream - the OutputStream the MFile contents should be written to
        offset - the index of the first byte to write out
        maxBytes - the maximum number of bytes to copy
        Throws:
        IOException
      • getChild

        public GcMFile getChild​(String newFilename)
        Description copied from interface: MFile
        Get child MFile of this MFile
        Specified by:
        getChild in interface MFile
        Parameters:
        newFilename - the relative file path of the new MFile
        Returns:
        the new MFile or null if the file can't be resolved