static class FileBrowser.LocalPath extends FileBrowser.MyPath
Modifier and Type | Field and Description |
---|---|
(package private) java.nio.file.WatchKey |
key |
(package private) java.nio.file.Path |
path |
(package private) static long |
serialVersionUID |
treeChildren, uri
Constructor and Description |
---|
LocalPath(java.net.URI uri)
For linux: root directory ends in '/', no other LocalPath does
For windows: top-level drives /x:/ ends in '/', no other LocalPath does
NB: InvalidPathException.getIndex() returns an index to the
unescaped URI - all %xx count as one character.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
copyFileFrom(FileBrowser.MyPath file)
Copies a file to this.
|
(package private) boolean |
copyFileTo(FileBrowser.LocalPath toFile)
Copy this to toFile.
|
(package private) boolean |
copyFileTo(FileBrowser.RemotePath toFile)
Copy this to toFile.
|
(package private) boolean |
delete()
Deletes a file or a symbolic link
|
boolean |
equals(java.lang.Object other) |
(package private) boolean |
exists()
Checks if the path refers to an existing file or directory.
|
(package private) java.lang.String |
fullName()
Returns the full path of this path
|
(package private) java.util.TreeSet<FileBrowser.TableData> |
getChildren(boolean dotFiles)
Enumerates all children (files and directories) of this path.
|
(package private) java.awt.datatransfer.DataFlavor |
getFlavor()
Returns the appropriate transfer DataFlavor for this MyPath.
|
(package private) long |
getMTime()
Returns the modification date of this file as the number of
milliseconds after 00:00:00 GMT, January 1, 1970.
|
(package private) FileBrowser.MyPath |
getParent()
returns a path to the parent of this path or null if there is
no parent.
|
(package private) java.util.ArrayList<FileBrowser.MyPath> |
getTreeChildren()
Only gets directories
|
int |
hashCode() |
(package private) boolean |
isDirectory()
Checks if the path refers to a directory.
|
(package private) boolean |
isFile()
Checks if the path refers to an ordinary file.
|
(package private) boolean |
isLink()
Checks if the path refers to a link.
|
(package private) boolean |
makeDirectory()
creates an empty directory at the location specified by this.
|
(package private) boolean |
makeLinkTo(byte[] target)
Creates a symbolic link from this to target.
|
(package private) void |
moveFileFrom(FileBrowser.MyPath file)
Moves a file or directory from one directory to
another.
|
(package private) void |
moveFileTo(FileBrowser.LocalPath other)
Move this to other.
|
(package private) void |
moveFileTo(FileBrowser.RemotePath other)
Move this to other.
|
(package private) java.util.List<java.lang.String> |
readAllLines()
Reads lines from this file and returns them as a List<String>
|
(package private) void |
readFile(byte[] data)
Will fill data with read information.
|
(package private) byte[] |
readLink()
Reads the link value (not it's target)
|
(package private) boolean |
renameFile(java.lang.String newName)
Renames this file or directory, keeping it in the same parent
directory.
|
(package private) FileBrowser.LocalPath |
resolve(java.nio.file.Path other)
Appends other to the current path and returns it.
|
(package private) FileBrowser.LocalPath |
resolve(java.lang.String other)
Appends other to the current path and returns it.
|
(package private) boolean |
setMTime(long time)
Sets the modification date of this file as the number of
milliseconds after 00:00:00 GMT, January 1, 1970.
|
(package private) long |
size()
Returns the length of the file in bytes refered to by this
path.
|
java.lang.String |
toString()
Returns the base name of this path
|
(package private) void |
touch()
Will touch file or directory.
|
(package private) void |
writeFile(byte[] data)
Will write data to file starting at offset.
|
getIndex
static final long serialVersionUID
java.nio.file.WatchKey key
java.nio.file.Path path
LocalPath(java.net.URI uri)
uri
- the URI to be converted to a Pathjava.awt.datatransfer.DataFlavor getFlavor()
FileBrowser.MyPath
getFlavor
in class FileBrowser.MyPath
boolean exists()
FileBrowser.MyPath
exists
in class FileBrowser.MyPath
boolean isDirectory()
FileBrowser.MyPath
isDirectory
in class FileBrowser.MyPath
boolean isFile()
FileBrowser.MyPath
isFile
in class FileBrowser.MyPath
boolean isLink()
FileBrowser.MyPath
isLink
in class FileBrowser.MyPath
FileBrowser.MyPath getParent()
FileBrowser.MyPath
getParent
in class FileBrowser.MyPath
java.util.TreeSet<FileBrowser.TableData> getChildren(boolean dotFiles)
FileBrowser.MyPath
getChildren
in class FileBrowser.MyPath
dotFiles
- true if dot files are to be includedjava.util.ArrayList<FileBrowser.MyPath> getTreeChildren()
getTreeChildren
in class FileBrowser.MyPath
FileBrowser.LocalPath resolve(java.lang.String other)
FileBrowser.MyPath
resolve
in class FileBrowser.MyPath
other
- the name to append to this pathFileBrowser.LocalPath resolve(java.nio.file.Path other)
FileBrowser.MyPath
resolve
in class FileBrowser.MyPath
other
- the name to append to this pathlong size()
FileBrowser.MyPath
size
in class FileBrowser.MyPath
long getMTime()
FileBrowser.MyPath
getMTime
in class FileBrowser.MyPath
boolean setMTime(long time)
FileBrowser.MyPath
setMTime
in class FileBrowser.MyPath
time
- Number of milliseconds after 00:00:00 GMT, January 1, 1970boolean makeDirectory()
FileBrowser.MyPath
makeDirectory
in class FileBrowser.MyPath
boolean renameFile(java.lang.String newName)
FileBrowser.MyPath
renameFile
in class FileBrowser.MyPath
newName
- the new name of the file or directoryvoid readFile(byte[] data)
FileBrowser.MyPath
readFile
in class FileBrowser.MyPath
data
- buffer to read data intovoid writeFile(byte[] data)
FileBrowser.MyPath
writeFile
in class FileBrowser.MyPath
data
- buffer to write data fromjava.util.List<java.lang.String> readAllLines()
FileBrowser.MyPath
readAllLines
in class FileBrowser.MyPath
byte[] readLink()
FileBrowser.MyPath
readLink
in class FileBrowser.MyPath
boolean makeLinkTo(byte[] target)
FileBrowser.MyPath
makeLinkTo
in class FileBrowser.MyPath
target
- the target of the linkvoid touch()
FileBrowser.MyPath
touch
in class FileBrowser.MyPath
void moveFileFrom(FileBrowser.MyPath file)
FileBrowser.MyPath
moveFileFrom
in class FileBrowser.MyPath
file
- the file to be moved to thisvoid moveFileTo(FileBrowser.LocalPath other)
FileBrowser.MyPath
moveFileTo
in class FileBrowser.MyPath
other
- directory to move this tovoid moveFileTo(FileBrowser.RemotePath other)
FileBrowser.MyPath
moveFileTo
in class FileBrowser.MyPath
other
- directory to move this toboolean copyFileFrom(FileBrowser.MyPath file)
FileBrowser.MyPath
copyFileFrom
in class FileBrowser.MyPath
file
- the file to be copiedboolean copyFileTo(FileBrowser.LocalPath toFile)
FileBrowser.MyPath
copyFileTo
in class FileBrowser.MyPath
toFile
- LocalPath to copy this toboolean copyFileTo(FileBrowser.RemotePath toFile)
FileBrowser.MyPath
copyFileTo
in class FileBrowser.MyPath
toFile
- RemotePath to copy this toboolean delete()
FileBrowser.MyPath
delete
in class FileBrowser.MyPath
public java.lang.String toString()
FileBrowser.MyPath
toString
in class FileBrowser.MyPath
java.lang.String fullName()
FileBrowser.MyPath
fullName
in class FileBrowser.MyPath
public boolean equals(java.lang.Object other)
equals
in class FileBrowser.MyPath
public int hashCode()
hashCode
in class FileBrowser.MyPath