|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoscript.fs.AbstractFileSystem
An interface implemented by something that can resolve AbstractFile
s.
Nested Class Summary | |
protected static class |
AbstractFileSystem.BogusFile
A non-existant file which is created to simulate non-existant directories that are in a path to a mount point, or files which simply don't exist. |
static class |
AbstractFileSystem.MountPointFile
A mount point file doesn't actually exist, but is used to simulate non existant components of the mount path of some file system. |
Field Summary | |
static char |
SEPERATOR_CHAR
The seperator character used for paths. |
Constructor Summary | |
AbstractFileSystem()
|
Method Summary | |
static java.lang.String |
basename(java.lang.String path)
Given a normalized path, return basename. |
static java.util.Collection |
children(AbstractFile file)
Get an iterator of the children of the specified file. |
static java.util.Collection |
children(java.lang.String path)
Get an iterator of the children of the specified file. |
protected abstract java.util.Collection |
childrenInFileSystem(java.lang.String mountPath,
java.lang.String path)
Return an iterator of children of the specified path. |
static java.lang.String |
dirname(java.lang.String path)
Given a normalized path, return dirname. |
protected abstract void |
flush()
Flush any pending changes within this filesystem. |
static java.lang.String |
getCwd()
Get the current working directory. |
protected long |
lastModified()
Return the last modification time of the root of the mount point itself. |
static void |
mount(AbstractFileSystem fs,
java.lang.String path)
Mount a new filesystem. |
static java.lang.String |
normalize(java.lang.String path)
Normalize the path. |
static java.lang.String |
normalize(java.lang.String cwd,
java.lang.String path)
|
static AbstractFile |
resolve(java.lang.String path)
Try to load the specified file from one of the mounted filesystems. |
protected abstract AbstractFile |
resolveInFileSystem(java.lang.String mountPath,
java.lang.String path)
Try to resolve the specified path. |
static void |
setCwd(java.lang.String cwd)
Set the current working directory. |
protected static void |
touchMountPoint(AbstractFileSystem fs)
When a file is created/deleted in the topmost directory in a mounted file system, it needs some way to cause the timestamp on the directory(s) it is mounted into to change. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final char SEPERATOR_CHAR
Constructor Detail |
public AbstractFileSystem()
Method Detail |
public static java.lang.String getCwd()
setCwd(java.lang.String)
public static void setCwd(java.lang.String cwd) throws java.io.IOException
IllegalArgumentException
.
cwd
- the new current working directory
java.io.IOException
- if the specified path is invalid.getCwd()
public static java.lang.String normalize(java.lang.String path)
public static java.lang.String normalize(java.lang.String cwd, java.lang.String path)
public static java.lang.String dirname(java.lang.String path)
public static java.lang.String basename(java.lang.String path)
protected static void touchMountPoint(AbstractFileSystem fs) throws java.io.IOException
fs
- the filesystem that was modified
java.io.IOException
public static void mount(AbstractFileSystem fs, java.lang.String path)
fs
- the filesystem to mountpath
- the path to the location to mount (ex: "/")public static AbstractFile resolve(java.lang.String path) throws java.io.IOException
path
- the file to resolve
java.io.IOException
- if something goes wrong when reading file#addScriptPath(AbstractFileSystem)
public static java.util.Collection children(java.lang.String path) throws java.io.IOException
path
- the path to the file to get children of
java.io.IOException
children(AbstractFile)
public static java.util.Collection children(AbstractFile file) throws java.io.IOException
file
- the file to get children of
java.io.IOException
children(String)
protected abstract AbstractFile resolveInFileSystem(java.lang.String mountPath, java.lang.String path) throws java.io.IOException
null
.
Note that this gets called under the synchronization of the abstract file
system, so it does not need to be re-entrant.
mountPath
- the path this fs is mounted at to resolve the requested filepath
- path to file, relative to mountPath
null
java.io.IOException
protected abstract java.util.Collection childrenInFileSystem(java.lang.String mountPath, java.lang.String path) throws java.io.IOException
mountPath
- the path this fs is mounted at to resolve the requested filepath
- path to file, relative to mountPath
AbstractFile
java.io.IOException
protected abstract void flush() throws java.io.IOException
java.io.IOException
protected long lastModified() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |