Modifier and Type | Method and Description |
---|---|
int |
compareTo(MFile o) |
boolean |
exists()
Check if the MFile exists
|
java.lang.Object |
getAuxInfo() |
MFile |
getChild(java.lang.String newFileName)
Get child MFile of this MFile
|
java.io.InputStream |
getInputStream()
Get the MFile InputStream
|
long |
getLastModified()
Get time of last modification at the time the MFile object was created
|
long |
getLength()
Size of file in bytes
|
java.lang.String |
getName()
The name is the farthest element from the root in the directory hierarchy.
|
MFile |
getParent()
Get the parent of this
|
java.lang.String |
getPath()
Get full path name, replace \\ with /
|
boolean |
isDirectory() |
default boolean |
isReadable() |
default boolean |
isZipFile()
Check if this MFile is a zip file
|
java.lang.String |
relativize(MFile other)
Construct a relative path between this MFile and a given MFile.
|
void |
setAuxInfo(java.lang.Object info) |
void |
writeToStream(java.io.OutputStream outputStream)
Write the MFile to an OutputStream
|
void |
writeToStream(java.io.OutputStream outputStream,
long offset,
long maxBytes)
Write the MFile to an OutputStream
|
long getLastModified()
long getLength()
boolean isDirectory()
default boolean isZipFile()
default boolean isReadable()
java.lang.String getPath()
java.lang.String getName()
MFile getParent() throws java.io.IOException
java.io.IOException
java.lang.Object getAuxInfo()
void setAuxInfo(java.lang.Object info)
boolean exists()
java.io.InputStream getInputStream() throws java.io.FileNotFoundException
java.io.FileNotFoundException
void writeToStream(java.io.OutputStream outputStream) throws java.io.IOException
outputStream
- the OutputStream the MFile contents should be written tojava.io.IOException
void writeToStream(java.io.OutputStream outputStream, long offset, long maxBytes) throws java.io.IOException
outputStream
- the OutputStream the MFile contents should be written tooffset
- the index of the first byte to write outmaxBytes
- the maximum number of bytes to copyjava.io.IOException
@Nullable MFile getChild(java.lang.String newFileName)
newFileName
- the relative file path of the new MFilejava.lang.String relativize(MFile other)
other
- the MFile to relativize against this MFile's path