Package com.mku.fs.file
Class HttpFile
- java.lang.Object
-
- com.mku.fs.file.HttpFile
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.mku.fs.file.IFile
IFile.CopyContentsOptions, IFile.CopyOptions, IFile.MoveOptions, IFile.RecursiveCopyOptions, IFile.RecursiveDeleteOptions, IFile.RecursiveMoveOptions
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringseparatorDirectory separator-
Fields inherited from interface com.mku.fs.file.IFile
autoRename
-
-
Constructor Summary
Constructors Constructor Description HttpFile(java.lang.String path)Instantiate a real file represented by the filepath provided (Remote read-write drive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFilecopy(IFile newDir)Move this file or directory under a new directory.IFilecopy(IFile newDir, IFile.CopyOptions options)Move this file or directory under a new directory.IFilecreateDirectory(java.lang.String dirName)Create a directory under this directory.IFilecreateFile(java.lang.String filename)Create a file under this directory.booleandelete()Delete this file or directory.booleanexists()Check if file or directory exists.IFilegetChild(java.lang.String filename)Get the file or directory under this directory with the provided name.intgetChildrenCount()Get the count of files and subdirectoriesjava.lang.StringgetDisplayPath()Get the display path on the physical disk.RandomAccessStreamgetInputStream()Get a stream for reading the file.longgetLastDateModified()Get the last modified date on disk.longgetLength()Get the size of the file on disk.java.lang.StringgetName()Get the name of this file or directory.RandomAccessStreamgetOutputStream()Get a stream for writing to this file.IFilegetParent()Get the parent directory of this file or directory.java.lang.StringgetPath()Get the path of this file.booleanisDirectory()Check if this is a directory.booleanisFile()Check if this is a file.IFile[]listFiles()List all files under this directory.booleanmkdir()Create this directory under the current filepath.IFilemove(IFile newDir)Move this file or directory under a new directory.IFilemove(IFile newDir, IFile.MoveOptions options)Move this file or directory under a new directory.booleanrenameTo(java.lang.String newFilename)Rename the current file or directory.voidreset()Reset cached propertiesjava.lang.StringtoString()Returns a string representation of this object-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.mku.fs.file.IFile
copyRecursively, copyRecursively, deleteRecursively, deleteRecursively, moveRecursively, moveRecursively
-
-
-
-
Field Detail
-
separator
public static final java.lang.String separator
Directory separator- See Also:
- Constant Field Values
-
-
Method Detail
-
createDirectory
public IFile createDirectory(java.lang.String dirName)
Create a directory under this directory.- Specified by:
createDirectoryin interfaceIFile- Parameters:
dirName- The name of the new directory.- Returns:
- The newly created directory.
-
createFile
public IFile createFile(java.lang.String filename) throws java.io.IOException
Create a file under this directory.- Specified by:
createFilein interfaceIFile- Parameters:
filename- The name of the new file.- Returns:
- The newly created file.
- Throws:
java.io.IOException- Thrown if there is an IO error.
-
delete
public boolean delete()
Delete this file or directory.
-
exists
public boolean exists()
Check if file or directory exists.
-
getDisplayPath
public java.lang.String getDisplayPath()
Get the display path on the physical disk.- Specified by:
getDisplayPathin interfaceIFile- Returns:
- The display path.
-
getName
public java.lang.String getName()
Get the name of this file or directory.
-
getInputStream
public RandomAccessStream getInputStream() throws java.io.FileNotFoundException
Get a stream for reading the file.- Specified by:
getInputStreamin interfaceIFile- Returns:
- The stream to read from.
- Throws:
java.io.FileNotFoundException- Thrown if file not found
-
getOutputStream
public RandomAccessStream getOutputStream() throws java.io.FileNotFoundException
Get a stream for writing to this file.- Specified by:
getOutputStreamin interfaceIFile- Returns:
- The stream to write to.
- Throws:
java.io.FileNotFoundException- Thrown if file not found
-
getParent
public IFile getParent()
Get the parent directory of this file or directory.
-
getPath
public java.lang.String getPath()
Get the path of this file.
-
isDirectory
public boolean isDirectory()
Check if this is a directory.- Specified by:
isDirectoryin interfaceIFile- Returns:
- True if it's a directory.
-
isFile
public boolean isFile()
Check if this is a file.
-
getLastDateModified
public long getLastDateModified()
Get the last modified date on disk.- Specified by:
getLastDateModifiedin interfaceIFile- Returns:
- The last modified date in milliseconds
-
getLength
public long getLength()
Get the size of the file on disk.
-
getChildrenCount
public int getChildrenCount()
Get the count of files and subdirectories- Specified by:
getChildrenCountin interfaceIFile- Returns:
- The children count
-
listFiles
public IFile[] listFiles()
List all files under this directory.
-
move
public IFile move(IFile newDir) throws java.io.IOException
Move this file or directory under a new directory. Not supported.
-
move
public IFile move(IFile newDir, IFile.MoveOptions options) throws java.io.IOException
Move this file or directory under a new directory. Not supported.
-
copy
public IFile copy(IFile newDir) throws java.io.IOException
Move this file or directory under a new directory. Not supported.
-
copy
public IFile copy(IFile newDir, IFile.CopyOptions options) throws java.io.IOException
Move this file or directory under a new directory. Not supported.
-
getChild
public IFile getChild(java.lang.String filename)
Get the file or directory under this directory with the provided name.
-
renameTo
public boolean renameTo(java.lang.String newFilename)
Rename the current file or directory.
-
mkdir
public boolean mkdir()
Create this directory under the current filepath.
-
toString
public java.lang.String toString()
Returns a string representation of this object- Overrides:
toStringin classjava.lang.Object
-
-