Package thredds.filesystem
Class MFileOS7
- java.lang.Object
-
- thredds.filesystem.MFileOS7
-
- All Implemented Interfaces:
Comparable<MFile>,MFile
@ThreadSafe public class MFileOS7 extends Object implements MFile
Use Java 7 nio Paths- Since:
- 11/16/13
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(MFile o)ObjectgetAuxInfo()static MFileOS7getExistingFile(String filename)Make MFileOS7 if file exists, otherwise return nulllonggetLastModified()Get time of last modification at the time the MFile object was createdlonggetLength()Size of file in bytesStringgetName()The name is the farthest element from the root in the directory hierarchy.PathgetNioPath()MFilegetParent()Get the parent of thisStringgetPath()Get full path name, replace \\ with /booleanisDirectory()booleanisReadable()voidsetAuxInfo(Object auxInfo)StringtoString()
-
-
-
Constructor Detail
-
MFileOS7
public MFileOS7(Path path) throws IOException
- Throws:
IOException
-
MFileOS7
public MFileOS7(Path path, BasicFileAttributes attr)
-
MFileOS7
public MFileOS7(String filename) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getExistingFile
public static MFileOS7 getExistingFile(String filename) throws IOException
Make MFileOS7 if file exists, otherwise return null- Parameters:
filename- full path name- Returns:
- MFileOS or null
- Throws:
IOException
-
getLastModified
public long getLastModified()
Description copied from interface:MFileGet time of last modification at the time the MFile object was created- Specified by:
getLastModifiedin interfaceMFile- Returns:
- time of last modification in Unix time (msecs since reference), or -1 if unknown
-
getLength
public long getLength()
Description copied from interface:MFileSize of file in bytes
-
isDirectory
public boolean isDirectory()
- Specified by:
isDirectoryin interfaceMFile
-
isReadable
public boolean isReadable()
- Specified by:
isReadablein interfaceMFile
-
getPath
public String getPath()
Description copied from interface:MFileGet full path name, replace \\ with /
-
getName
public String getName()
Description copied from interface:MFileThe name is the farthest element from the root in the directory hierarchy.
-
getParent
public MFile getParent() throws IOException
Description copied from interface:MFileGet the parent of this- Specified by:
getParentin interfaceMFile- Returns:
- the parent or null
- Throws:
IOException
-
compareTo
public int compareTo(MFile o)
- Specified by:
compareToin interfaceComparable<MFile>- Specified by:
compareToin interfaceMFile
-
getAuxInfo
public Object getAuxInfo()
- Specified by:
getAuxInfoin interfaceMFile
-
setAuxInfo
public void setAuxInfo(Object auxInfo)
- Specified by:
setAuxInfoin interfaceMFile
-
getNioPath
public Path getNioPath()
-
-