Interface MFile

    • Method Detail

      • getLastModified

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

        long getLength()
        Size of file in bytes
        Returns:
        Size of file in bytes or -1 if unknown
      • isDirectory

        boolean isDirectory()
      • isZipFile

        default boolean isZipFile()
        Check if this MFile is a zip file
        Returns:
        true if the MFile is a zip file
      • isReadable

        default boolean isReadable()
      • getPath

        String getPath()
        Get full path name, replace \\ with /
        Returns:
        full path name
      • getName

        String getName()
        The name is the farthest element from the root in the directory hierarchy.
        Returns:
        the file name
      • getAuxInfo

        Object getAuxInfo()
      • setAuxInfo

        void setAuxInfo​(Object info)
      • exists

        boolean exists()
        Check if the MFile exists
        Returns:
        true if the MFile exists, else false
      • writeToStream

        void writeToStream​(OutputStream outputStream)
                    throws IOException
        Write the MFile to an OutputStream
        Parameters:
        outputStream - the OutputStream the MFile contents should be written to
        Throws:
        IOException
      • writeToStream

        void writeToStream​(OutputStream outputStream,
                           long offset,
                           long maxBytes)
                    throws IOException
        Write the MFile to an OutputStream
        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

        @Nullable
        MFile getChild​(String newFileName)
        Get child MFile of this MFile
        Parameters:
        newFileName - the relative file path of the new MFile
        Returns:
        the new MFile or null if the file can't be resolved