public class FilePath extends FilesystemPath
Path.FileChannelFactory| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_isWindows |
_bindRoot, _pathname, _root, _userPath_pathSeparatorChar, _schemeMap, _separatorChar, L| Modifier | Constructor and Description |
|---|---|
protected |
FilePath(FilesystemPath root,
java.lang.String userPath,
java.lang.String path) |
|
FilePath(java.lang.String path) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead()
Tests if the file can be read.
|
boolean |
canWrite()
Tests if the file can be written.
|
Path |
copy() |
boolean |
equals(java.lang.Object b) |
boolean |
exists()
Tests if the file exists.
|
Path.FileChannelFactory |
fileChannelFactory() |
Path |
fsWalk(java.lang.String userPath,
java.util.Map<java.lang.String,java.lang.Object> attributes,
java.lang.String path)
Lookup the actual path relative to the filesystem root.
|
long |
getDiskSpaceFree() |
long |
getDiskSpaceTotal() |
java.io.File |
getFile()
Lazily returns the native File object.
|
long |
getLastModified()
Returns the last modified time of the file.
|
long |
getLength()
Returns the length of the file in bytes.
|
int |
getMode()
Returns equivalent of struct stat.st_mode if appropriate.
|
java.lang.String |
getNativePath()
Returns the native path.
|
static java.lang.String |
getPwd()
Gets the system's user dir (pwd) and convert it to the Resin format.
|
java.lang.String |
getScheme()
Returns the url scheme
|
java.lang.String |
getURL()
Returns the full url for the given path.
|
int |
hashCode() |
protected static java.lang.String |
initialPath(java.lang.String path) |
protected boolean |
isAux()
Special case for the evil windows special
|
boolean |
isDirectory()
Tests if the path refers to a directory.
|
boolean |
isFile()
Tests if the path refers to a file.
|
boolean |
isLink()
Tests if the path refers to a symbolic link.
|
protected boolean |
isPathCacheable()
Returns true if the path itself is cacheable
|
java.lang.String[] |
list()
Returns a list of files in the directory.
|
boolean |
mkdir()
Creates the directory named by this path.
|
boolean |
mkdirs()
Creates the directory named by this path and any parent directories.
|
StreamImpl |
openAppendImpl() |
RandomAccessStream |
openFileRandomAccess()
Returns the stream implementation for a random-access stream.
|
RandomAccessStream |
openMemoryMappedFile(long fileSize)
Opens a random-access stream.
|
StreamImpl |
openReadImpl()
Returns the stream implementation for a read stream.
|
StreamImpl |
openReadWriteImpl() |
StreamImpl |
openWriteImpl() |
boolean |
remove()
Removes the file or directory named by this path.
|
boolean |
renameTo(Path path)
Renames the file or directory to the name given by the path.
|
Path |
schemeWalk(java.lang.String userPath,
java.util.Map<java.lang.String,java.lang.Object> attributes,
java.lang.String filePath,
int offset)
Lookup the path, handling windows weirdness
|
void |
setLastModified(long time) |
boolean |
truncate(long length)
Sets the length of the file.
|
bind, createRoot, getFullPath, getParent, getPath, getRoot, getTail, getUserPath, init, normalizePath, normalizePath, setUserPathcacheCopy, canExecute, changeGroup, changeGroup, changeOwner, changeOwner, chmod, clearStatusCache, compareTo, createDepend, createLink, createNewFile, createRoot, createTempFile, escapeURL, getAttribute, getAttributeNames, getBlockCount, getBlockSize, getCache, getCertificates, getContentType, getCrc64, getCreateTime, getDevice, getDeviceId, getFileSeparatorChar, getGroup, getHost, getInode, getLastAccessTime, getLastStatusChangeTime, getNewlineString, getNumberOfLinks, getObject, getOwner, getPathSeparatorChar, getPort, getQuery, getRelativePath, getResources, getResources, getSchemeMap, getSeparatorChar, getUser, getUserDir, getValue, isBlockDevice, isCharacterDevice, isExecutable, isFIFO, isHardLink, isObject, isSocket, isSymbolicLink, isWindows, isWindowsInsecure, iterator, lookup, lookup, lookup, lookupChild, lookupImpl, lookupNative, lookupNative, lookupRelativeNativePath, openAppend, openRandomAccess, openRead, openReadWrite, openReadWrite, openReadWrite, openWrite, putCache, readLink, realPath, removeAll, renameTo, scanScheme, sendfile, setDefaultSchemeMap, setExecutable, setObject, setTestWindows, setValue, toString, truncate, unbind, unwrap, writeToStream, writeToStreamprotected FilePath(FilesystemPath root, java.lang.String userPath, java.lang.String path)
path - canonical pathpublic FilePath(java.lang.String path)
protected static java.lang.String initialPath(java.lang.String path)
public static java.lang.String getPwd()
public long getDiskSpaceFree()
getDiskSpaceFree in class Pathpublic long getDiskSpaceTotal()
getDiskSpaceTotal in class Pathpublic Path schemeWalk(java.lang.String userPath, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String filePath, int offset)
schemeWalk in class FilesystemPathuserPath - the user's lookup() pathattributes - the user's attributesfilePath - the actual lookup() pathoffset - offset into filePathpublic Path fsWalk(java.lang.String userPath, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String path)
fsWalk in class FilesystemPathuserPath - the user's path to lookup()attributes - the user's attributes to lookup()path - the normalized pathprotected boolean isPathCacheable()
isPathCacheable in class Pathpublic java.lang.String getScheme()
Pathpublic java.lang.String getURL()
public java.lang.String getNativePath()
getNativePath in class Pathpublic boolean exists()
Pathpublic int getMode()
Pathpublic boolean isDirectory()
PathisDirectory in class Pathpublic boolean isFile()
Pathpublic boolean isLink()
Pathpublic long getLength()
Pathpublic long getLastModified()
PathgetLastModified in class Pathpublic void setLastModified(long time)
setLastModified in class Pathpublic boolean canRead()
Pathpublic boolean canWrite()
Pathpublic java.lang.String[] list()
throws java.io.IOException
public boolean mkdir()
throws java.io.IOException
Pathpublic boolean mkdirs()
throws java.io.IOException
Pathpublic boolean remove()
Pathpublic boolean truncate(long length)
throws java.io.IOException
Pathpublic boolean renameTo(Path path)
Pathpublic StreamImpl openReadImpl() throws java.io.IOException
openReadImpl in class Pathjava.io.IOExceptionpublic StreamImpl openWriteImpl() throws java.io.IOException
openWriteImpl in class Pathjava.io.IOExceptionpublic StreamImpl openAppendImpl() throws java.io.IOException
openAppendImpl in class Pathjava.io.IOExceptionpublic StreamImpl openReadWriteImpl() throws java.io.IOException
openReadWriteImpl in class Pathjava.io.IOExceptionpublic RandomAccessStream openFileRandomAccess() throws java.io.IOException
openFileRandomAccess in class Pathjava.io.IOExceptionpublic RandomAccessStream openMemoryMappedFile(long fileSize) throws java.io.IOException
PathopenMemoryMappedFile in class Pathjava.io.IOExceptionpublic Path.FileChannelFactory fileChannelFactory()
fileChannelFactory in class Pathpublic int hashCode()
hashCode in class FilesystemPathpublic boolean equals(java.lang.Object b)
equals in class FilesystemPathpublic java.io.File getFile()
protected boolean isAux()