Constructor and Description |
---|
MFileOS7(java.nio.file.Path path) |
MFileOS7(java.nio.file.Path path,
java.nio.file.attribute.BasicFileAttributes attr) |
MFileOS7(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() |
MFileOS7 |
getChild(java.lang.String newFilename)
Get child MFile of this MFile
|
static MFileOS7 |
getExistingFile(java.lang.String filename)
Make MFileOS7 if file exists, otherwise return null
|
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.
|
java.nio.file.Path |
getNioPath() |
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 MFileOS7(java.nio.file.Path path) throws java.io.IOException
java.io.IOException
public MFileOS7(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes attr)
public MFileOS7(java.lang.String filename) throws java.io.IOException
java.io.IOException
public static MFileOS7 getExistingFile(java.lang.String filename) throws java.io.IOException
filename
- full path namejava.io.IOException
public long getLastModified()
MFile
getLastModified
in interface MFile
public long getLength()
MFile
public boolean isDirectory()
isDirectory
in interface MFile
public boolean isReadable()
isReadable
in interface MFile
public java.lang.String getPath()
MFile
public java.lang.String getName()
MFile
public MFile getParent() throws java.io.IOException
MFile
public int compareTo(MFile o)
public java.lang.Object getAuxInfo()
getAuxInfo
in interface MFile
public void setAuxInfo(java.lang.Object auxInfo)
setAuxInfo
in interface MFile
public java.lang.String toString()
toString
in class java.lang.Object
public boolean exists()
MFile
public java.io.FileInputStream getInputStream() throws java.io.FileNotFoundException
MFile
getInputStream
in interface MFile
java.io.FileNotFoundException
public void writeToStream(java.io.OutputStream outputStream) throws java.io.IOException
MFile
writeToStream
in interface MFile
outputStream
- the OutputStream the MFile contents should be written tojava.io.IOException
public void writeToStream(java.io.OutputStream outputStream, long offset, long maxBytes) throws java.io.IOException
MFile
writeToStream
in interface MFile
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
public MFileOS7 getChild(java.lang.String newFilename)
MFile
public java.nio.file.Path getNioPath()
public java.lang.String relativize(MFile other)
MFile
relativize
in interface MFile
other
- the MFile to relativize against this MFile's path