public static class LocalFileSystem.Impl extends Object implements AbstractFileSystem.List, AbstractFileSystem.Info, AbstractFileSystem.SymlinkInfo, AbstractFileSystem.Change
| Constructor and Description |
|---|
Impl(LocalFileSystem fs)
Pointer to local filesystem
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
children(String name)
Get a list of children files for a given folder.
|
void |
createData(String name)
Create new data file.
|
void |
createFolder(String name)
Create new folder.
|
void |
delete(String name)
Delete a file.
|
boolean |
folder(String name)
Test if the file is a folder or contains data.
|
String |
getCanonicalName(String name)
Get canonical file name (resolve all symbolic links).
|
InputStream |
inputStream(String name)
Get input stream.
|
boolean |
isSymbolicLink(String name)
Check whether a file represents a symbolic link.
|
Date |
lastModified(String name)
Get last modification time.
|
void |
lock(String name)
Lock the file.
|
void |
markUnimportant(String name)
Mark the file as being unimportant.
|
String |
mimeType(String name)
Get the MIME type of the file.
|
OutputStream |
outputStream(String name)
Get output stream.
|
boolean |
readOnly(String name)
Test whether this file can be written to or not.
|
String |
readSymbolicLink(String name)
Read symbolic link.
|
void |
rename(String oldName,
String newName)
Rename a file.
|
long |
size(String name)
Get the size of the file.
|
void |
unlock(String name)
Unlock the file.
|
public Impl(LocalFileSystem fs)
fs - the filesystem this impl is connected topublic String[] children(String name)
AbstractFileSystem.Listchildren in interface AbstractFileSystem.Listname - the folder, by name; e.g. top/next/afterthatfile.ext (no path)
the array can contain null values that will be ignoredpublic void createFolder(String name) throws IOException
AbstractFileSystem.ChangecreateFolder in interface AbstractFileSystem.Changename - full name of new folder, e.g. topfolder/newfolderIOException - if the operation failspublic void createData(String name) throws IOException
AbstractFileSystem.ChangecreateData in interface AbstractFileSystem.Changename - full name of the file, e.g. path/from/root/filename.extIOException - if the file cannot be created (e.g. already exists)public void rename(String oldName, String newName) throws IOException
AbstractFileSystem.Changerename in interface AbstractFileSystem.ChangeoldName - old name of the file; fully qualifiednewName - new name of the file; fully qualifiedIOException - if it could not be renamedpublic void delete(String name) throws IOException
AbstractFileSystem.Changedelete in interface AbstractFileSystem.Changename - name of file; fully qualifiedIOException - if the file could not be deletedpublic Date lastModified(String name)
AbstractFileSystem.InfolastModified in interface AbstractFileSystem.Infoname - the file to testpublic boolean folder(String name)
AbstractFileSystem.Infofolder in interface AbstractFileSystem.Infoname - name of the filetrue if the file is folder, false if it is datapublic boolean readOnly(String name)
AbstractFileSystem.InforeadOnly in interface AbstractFileSystem.Infoname - the file to testtrue if the file is read-onlypublic String mimeType(String name)
AbstractFileSystem.InfomimeType in interface AbstractFileSystem.Infoname - the file to test"text/plain")
or null if no special support for recognizing MIME is implemented.public long size(String name)
AbstractFileSystem.Infosize in interface AbstractFileSystem.Infoname - the file to testpublic InputStream inputStream(String name) throws FileNotFoundException
AbstractFileSystem.InfoinputStream in interface AbstractFileSystem.Infoname - the file to testFileNotFoundException - if the file does not exist or is invalidpublic OutputStream outputStream(String name) throws IOException
AbstractFileSystem.InfooutputStream in interface AbstractFileSystem.Infoname - the file to testIOException - if an error occurs (the file is invalid, etc.)public void lock(String name) throws IOException
AbstractFileSystem.InfoFileLock within NetBeans, however.lock in interface AbstractFileSystem.Infoname - name of the fileIOException - (e.g. FileAlreadyLockedException) if the file is already locked or otherwise cannot be lockedpublic void unlock(String name)
AbstractFileSystem.Infounlock in interface AbstractFileSystem.Infoname - name of the filepublic void markUnimportant(String name)
AbstractFileSystem.InfomarkUnimportant in interface AbstractFileSystem.Infoname - the file to markpublic boolean isSymbolicLink(String name) throws IOException
AbstractFileSystem.SymlinkInfoisSymbolicLink in interface AbstractFileSystem.SymlinkInfoname - Name of the file.IOException - If some I/O problem occurs.AbstractFileSystem.SymlinkInfo.readSymbolicLink(java.lang.String),
AbstractFileSystem.SymlinkInfo.getCanonicalName(java.lang.String)public String readSymbolicLink(String name) throws IOException
AbstractFileSystem.SymlinkInfoIllegalArgumentException can be thrown.
This method does not perform any normalization. If the target of
symbolic link is defined using relative path, this relative path will
be returned.readSymbolicLink in interface AbstractFileSystem.SymlinkInfoname - Name of the file.name does not represent symbolic
link.IOException - If some I/O problem occurs.AbstractFileSystem.SymlinkInfo.isSymbolicLink(java.lang.String)public String getCanonicalName(String name) throws IOException
AbstractFileSystem.SymlinkInfogetCanonicalName in interface AbstractFileSystem.SymlinkInfoname - Name of the file.name and
where all symbolic links are resolved.IOException - If some I/O problem occurs.