-
- All Implemented Interfaces:
-
com.github.mjdev.libaums.fs.UsbFile,java.io.Closeable,java.lang.AutoCloseable
public abstract class AbstractUsbFile implements UsbFile
Created by magnusja on 3/1/17.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classAbstractUsbFile.Companion
-
Constructor Summary
Constructors Constructor Description AbstractUsbFile()
-
Method Summary
Modifier and Type Method Description StringgetAbsolutePath()Absolute path of a file or directory. abstract BooleangetIsDirectory()abstract StringgetName()Set a new name for this file or directory. abstract UnitsetName(String name)Set a new name for this file or directory. abstract UsbFilegetParent()Returns the parent directory for the file or directory or null if this is the root directory. abstract LonggetLength()Sets the new file length. abstract UnitsetLength(Long length)Sets the new file length. abstract BooleangetIsRoot()UsbFilesearch(String path)Tries to search a corresponding entry associated with the path parameter. IntegerhashCode()StringtoString()Booleanequals(Object other)-
Methods inherited from class com.github.mjdev.libaums.fs.AbstractUsbFile
close, createDirectory, createFile, createdAt, delete, flush, lastAccessed, lastModified, list, listFiles, moveTo, read, write -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getAbsolutePath
String getAbsolutePath()
Absolute path of a file or directory.
-
getIsDirectory
abstract Boolean getIsDirectory()
-
setName
abstract Unit setName(String name)
Set a new name for this file or directory.
- Parameters:
name- The new name.
-
getParent
abstract UsbFile getParent()
Returns the parent directory for the file or directory or null if this is the root directory.
-
getLength
abstract Long getLength()
Sets the new file length. This can sometimes be more efficient if all needed place for a file is allocated on the disk at once and before writing to it.
If the space is not allocated before writing the space must be exceeded every time a new write occurs. This can sometimes be less efficient.
-
setLength
abstract Unit setLength(Long length)
Sets the new file length. This can sometimes be more efficient if all needed place for a file is allocated on the disk at once and before writing to it.
If the space is not allocated before writing the space must be exceeded every time a new write occurs. This can sometimes be less efficient.
- Parameters:
length- The file length in bytes.
-
search
UsbFile search(String path)
Tries to search a corresponding entry associated with the path parameter. Path separator is '/'. Parameter path must not start with an '/' (except if querying from root directory). Path is treated relative to current UsbFile.
- Parameters:
path- The path to the resource to search.
-
-
-
-