public class LocalFileSystem extends java.lang.Object implements FileSystem
LocalFileSystem ...SEPARATOR, SEPARATOR_CHAR| Constructor and Description |
|---|
LocalFileSystem()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the file system.
|
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 |
equals(java.lang.Object obj) |
boolean |
exists(java.lang.String path)
Tests whether the file system entry denoted by this path exists.
|
java.lang.String |
getEnableHandleMonitor()
Returns
true if use of the handle monitor is currently
enabled, otherwise returns false. |
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.
|
java.lang.String |
getPath() |
boolean |
hasChildren(java.lang.String path)
Tests whether the file system entry denoted by this path has child entries.
|
int |
hashCode()
Returns zero to satisfy the Object equals/hashCode contract.
|
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 |
setEnableHandleMonitor(boolean enable)
Enables/Disables the use of the handle monitor.
|
void |
setEnableHandleMonitor(java.lang.String enable)
Enables/Disables the use of the handle monitor.
|
void |
setPath(java.lang.String rootPath)
Sets the path to the root directory of this local filesystem.
|
void |
setRoot(java.io.File root) |
public java.lang.String getPath()
public void setPath(java.lang.String rootPath)
rootPath - the path to the root directorypublic void setRoot(java.io.File root)
public void setEnableHandleMonitor(java.lang.String enable)
enable - public void setEnableHandleMonitor(boolean enable)
enable - flagpublic java.lang.String getEnableHandleMonitor()
true if use of the handle monitor is currently
enabled, otherwise returns false.setEnableHandleMonitor(boolean)public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public void init()
throws FileSystemException
init in interface FileSystemFileSystemException - if the file system initialization failspublic void close()
throws FileSystemException
close in interface FileSystemFileSystemExceptionpublic void createFolder(java.lang.String folderPath)
throws FileSystemException
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
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
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
exists in interface FileSystempath - the path of a file system entry.FileSystemExceptionpublic java.io.InputStream getInputStream(java.lang.String filePath)
throws FileSystemException
getInputStream in interface FileSystemfilePath - the path of the file.FileSystemException - if the file does not exist
or if it cannot be read frompublic java.io.OutputStream getOutputStream(java.lang.String filePath)
throws FileSystemException
getOutputStream in interface FileSystemfilePath - the path of the file.FileSystemException - if the file cannot be written to or createdpublic boolean hasChildren(java.lang.String path)
throws FileSystemException
hasChildren in interface FileSystempath - the path of a file system entry.FileSystemExceptionpublic boolean isFile(java.lang.String path)
throws FileSystemException
isFile in interface FileSystempath - the path of a file system entry.FileSystemExceptionpublic boolean isFolder(java.lang.String path)
throws FileSystemException
isFolder in interface FileSystempath - the path of a file system entry.FileSystemExceptionpublic long lastModified(java.lang.String path)
throws FileSystemException
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
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)
throws FileSystemException
list in interface FileSystemfolderPath - the path of the folder whose contents is to be listed.FileSystemException - if this path does not denote a folder or if
another error occurs.public java.lang.String[] listFiles(java.lang.String folderPath)
throws FileSystemException
listFiles in interface FileSystemfolderPath - the path of the folder whose contents is to be listed.FileSystemException - if this path does not denote a folder or if
another error occurs.public java.lang.String[] listFolders(java.lang.String folderPath)
throws FileSystemException
listFolders in interface FileSystemfolderPath - the path of the folder whose contents is to be listed.FileSystemException - if this path does not denote a folder or if
another error occurs.Copyright © 2010 - 2023 Adobe. All Rights Reserved