|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.fs.mem.MemoryFileSystem
public class MemoryFileSystem
| Field Summary |
|---|
| Fields inherited from interface org.apache.jackrabbit.core.fs.FileSystem |
|---|
SEPARATOR, SEPARATOR_CHAR |
| Constructor Summary | |
|---|---|
MemoryFileSystem()
|
|
| Method Summary | |
|---|---|
void |
close()
Close the file system. |
void |
copy(java.lang.String srcPath,
java.lang.String destPath)
Copies a file or folder to a new location. |
void |
createFolder(java.lang.String folderPath)
Creates the folder named by this path, including any necessary but nonexistent parent folders. |
void |
deleteFile(java.lang.String filePath)
Deletes the file denoted by this path. |
void |
deleteFolder(java.lang.String folderPath)
Deletes the folder denoted by this path. |
boolean |
exists(java.lang.String path)
Tests whether the file system entry denoted by this path exists. |
java.io.InputStream |
getInputStream(java.lang.String filePath)
Returns an input stream of the contents of the file denoted by this path. |
java.io.OutputStream |
getOutputStream(java.lang.String filePath)
Returns an output stream for writing bytes to the file denoted by this path. |
RandomAccessOutputStream |
getRandomAccessOutputStream(java.lang.String filePath)
Returns an output stream for writing bytes to the file denoted by this path. |
boolean |
hasChildren(java.lang.String path)
Tests whether the file system entry denoted by this path has child entries. |
void |
init()
Initialize the file system |
boolean |
isFile(java.lang.String path)
Tests whether the file system entry denoted by this path exists and is a file. |
boolean |
isFolder(java.lang.String path)
Tests whether the file system entry denoted by this path exists and is a folder. |
long |
lastModified(java.lang.String path)
Returns the time that the file system entry denoted by this path was last modified. |
long |
length(java.lang.String filePath)
Returns the length of the file denoted by this path. |
java.lang.String[] |
list(java.lang.String folderPath)
Returns an array of strings naming the files and folders in the folder denoted by this path. |
java.lang.String[] |
listFiles(java.lang.String folderPath)
Returns an array of strings naming the files in the folder denoted by this path. |
java.lang.String[] |
listFolders(java.lang.String folderPath)
Returns an array of strings naming the folders in the folder denoted by this path. |
void |
move(java.lang.String srcPath,
java.lang.String destPath)
Moves a file or folder to a new location. |
void |
touch(java.lang.String filePath)
Set the modified time of an existing file to now. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MemoryFileSystem()
| Method Detail |
|---|
public void close()
FileSystem
close in interface FileSystem
public void copy(java.lang.String srcPath,
java.lang.String destPath)
throws FileSystemException
FileSystem
copy in interface FileSystemsrcPath - the path of the file or folder to be copied.destPath - the destination path to which the file or folder is to be copied.
FileSystemException - if the copy fails
public void createFolder(java.lang.String folderPath)
throws FileSystemException
FileSystem
createFolder in interface FileSystemfolderPath - the path of the folder to be created.
FileSystemException - if a file system entry denoted by path
already exists or if another error occurs.
public void deleteFile(java.lang.String filePath)
throws FileSystemException
FileSystem
deleteFile in interface FileSystemfilePath - the path of the file to be deleted.
FileSystemException - if this path does not denote a file or if
another error occurs.
public void deleteFolder(java.lang.String folderPath)
throws FileSystemException
FileSystem
deleteFolder in interface FileSystemfolderPath - the path of the folder to be deleted.
FileSystemException - if this path does not denote a folder or if
another error occurs.
public boolean exists(java.lang.String path)
throws FileSystemException
FileSystem
exists in interface FileSystempath - the path of a file system entry.
FileSystemException
public java.io.InputStream getInputStream(java.lang.String filePath)
throws FileSystemException
FileSystem
getInputStream in interface FileSystemfilePath - the path of the file.
FileSystemException - if the file does not exist
or if it cannot be read from
public java.io.OutputStream getOutputStream(java.lang.String filePath)
throws FileSystemException
FileSystem
getOutputStream in interface FileSystemfilePath - the path of the file.
FileSystemException - if the file cannot be written to or created
public RandomAccessOutputStream getRandomAccessOutputStream(java.lang.String filePath)
throws java.lang.UnsupportedOperationException
FileSystem0. See also
RandomAccessOutputStream.seek(long);
getRandomAccessOutputStream in interface FileSystemfilePath - the path of the file.
java.lang.UnsupportedOperationException - if the implementation does
not support file access through a
RandomAccessOutputStream.
public boolean hasChildren(java.lang.String path)
throws FileSystemException
FileSystem
hasChildren in interface FileSystempath - the path of a file system entry.
FileSystemExceptionpublic void init()
FileSystem
init in interface FileSystem
public boolean isFile(java.lang.String path)
throws FileSystemException
FileSystem
isFile in interface FileSystempath - the path of a file system entry.
FileSystemException
public boolean isFolder(java.lang.String path)
throws FileSystemException
FileSystem
isFolder in interface FileSystempath - the path of a file system entry.
FileSystemException
public long lastModified(java.lang.String path)
throws FileSystemException
FileSystem
lastModified in interface FileSystempath - the path of a file system entry.
FileSystemException - if the file system entry does not exist.
public long length(java.lang.String filePath)
throws FileSystemException
FileSystem
length in interface FileSystemfilePath - the path of the file.
FileSystemException - if the path does not denote an existing file.public java.lang.String[] list(java.lang.String folderPath)
FileSystem
list in interface FileSystemfolderPath - the path of the folder whose contents is to be listed.
public java.lang.String[] listFiles(java.lang.String folderPath)
FileSystem
listFiles in interface FileSystemfolderPath - the path of the folder whose contents is to be listed.
public java.lang.String[] listFolders(java.lang.String folderPath)
FileSystem
listFolders in interface FileSystemfolderPath - the path of the folder whose contents is to be listed.
public void move(java.lang.String srcPath,
java.lang.String destPath)
throws FileSystemException
FileSystem
move in interface FileSystemsrcPath - the path of the file or folder to be moved.destPath - the destination path to which the file or folder is to be moved.
FileSystemException - if the move fails
public void touch(java.lang.String filePath)
throws FileSystemException
FileSystem
touch in interface FileSystemfilePath - the path of the file.
FileSystemException - if the path does not denote an existing file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||