| Constructor and Description |
|---|
MFileOS(java.io.File file) |
MFileOS(java.lang.String filename) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(MFile o) |
boolean |
exists()
Check if the MFile exists
|
java.lang.Object |
getAuxInfo() |
MFileOS |
getChild(java.lang.String newFilename)
Get child MFile of this MFile
|
static MFileOS |
getExistingFile(java.lang.String filename)
Make MFileOS if file exists, otherwise return null
|
java.io.File |
getFile() |
java.io.FileInputStream |
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() |
boolean |
isReadable() |
java.lang.String |
relativize(MFile other)
Construct a relative path between this MFile and a given MFile.
|
void |
setAuxInfo(java.lang.Object auxInfo) |
java.lang.String |
toString() |
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
|
public MFileOS(java.io.File file)
public MFileOS(java.lang.String filename)
@Nullable public static MFileOS getExistingFile(java.lang.String filename)
filename - name of the existing file.public long getLastModified()
MFilegetLastModified in interface MFilepublic long getLength()
MFilepublic boolean isDirectory()
isDirectory in interface MFilepublic boolean isReadable()
isReadable in interface MFilepublic java.lang.String getPath()
MFilepublic java.lang.String getName()
MFile@Nullable public MFile getParent()
MFilepublic int compareTo(MFile o)
public java.lang.Object getAuxInfo()
getAuxInfo in interface MFilepublic void setAuxInfo(java.lang.Object auxInfo)
setAuxInfo in interface MFilepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean exists()
MFilepublic java.io.FileInputStream getInputStream()
throws java.io.FileNotFoundException
MFilegetInputStream in interface MFilejava.io.FileNotFoundExceptionpublic void writeToStream(java.io.OutputStream outputStream)
throws java.io.IOException
MFilewriteToStream in interface MFileoutputStream - the OutputStream the MFile contents should be written tojava.io.IOExceptionpublic void writeToStream(java.io.OutputStream outputStream,
long offset,
long maxBytes)
throws java.io.IOException
MFilewriteToStream in interface MFileoutputStream - 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.IOExceptionpublic java.io.File getFile()
public MFileOS getChild(java.lang.String newFilename)
MFilepublic java.lang.String relativize(MFile other)
MFilerelativize in interface MFileother - the MFile to relativize against this MFile's path