public class LocalFileSystem extends AbstractFileSystem
For historical reasons many AbstractFileSystem.* methods are implemented as protected in this class. Do not call them! Subclasses might override them, or (better) use delegation.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
LocalFileSystem.Impl |
The implementation class that implements List, Info
and Change interfaces and delegates all the methods
to appropriate methods of LocalFileSystem.
|
AbstractFileSystem.Attr, AbstractFileSystem.Change, AbstractFileSystem.Info, AbstractFileSystem.List, AbstractFileSystem.SymlinkInfo, AbstractFileSystem.TransferFileSystem.AtomicActionattr, change, info, list, transferPROP_DISPLAY_NAME, PROP_HIDDEN, PROP_READ_ONLY, PROP_ROOT, PROP_SYSTEM_NAME, PROP_VALID| Constructor | Description |
|---|---|
LocalFileSystem() |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected java.lang.String[] |
children(java.lang.String name) |
|
protected java.lang.String |
computeSystemName(java.io.File rootFile) |
Compute the system name of this filesystem for a given root directory.
|
protected void |
createData(java.lang.String name) |
|
protected void |
createFolder(java.lang.String name) |
|
protected void |
delete(java.lang.String name) |
|
protected boolean |
folder(java.lang.String name) |
|
java.lang.String |
getDisplayName() |
Provides a name for the system that can be presented to the user.
|
java.io.File |
getRootDirectory() |
Get the root directory of the filesystem.
|
protected java.io.InputStream |
inputStream(java.lang.String name) |
|
boolean |
isReadOnly() |
Test if the filesystem is read-only or not.
|
protected java.util.Date |
lastModified(java.lang.String name) |
|
protected void |
lock(java.lang.String name) |
|
protected void |
markUnimportant(java.lang.String name) |
|
protected java.lang.String |
mimeType(java.lang.String name) |
|
protected java.io.OutputStream |
outputStream(java.lang.String name) |
|
protected boolean |
readOnly(java.lang.String name) |
|
protected void |
rename(java.lang.String oldName,
java.lang.String newName) |
|
void |
setReadOnly(boolean flag) |
Set whether the filesystem should be read only.
|
void |
setRootDirectory(java.io.File r) |
Set the root directory of the filesystem.
|
protected long |
size(java.lang.String name) |
|
protected void |
unlock(java.lang.String name) |
canRead, canWrite, checkVirtual, createReference, existingFileObjects, findReference, findResource, getRefreshTime, getRoot, markImportant, refresh, refreshResource, refreshRoot, setRefreshTimeaddFileChangeListener, addFileStatusListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, createTempFile, find, findExtrasFor, fireFileStatusChanged, firePropertyChange, fireVetoableChange, getDecorator, getSystemName, getTempFolder, isDefault, isValid, removeFileChangeListener, removeFileStatusListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, runAtomicAction, setSystemName, toStringpublic java.lang.String getDisplayName()
FileSystem
This call should never be used to attempt to identify the file root
of the filesystem. On some systems it may happen to look the same but this is a
coincidence and may well change in the future. Either check whether
you are working with a LocalFileSystem or similar implementation and use
getRootDirectory(); or better, try
FileUtil.toFile(org.openide.filesystems.FileObject) which is designed to do this correctly.
Note: for most purposes it is probably a bad idea to use
this method. Instead look at FileUtil.getFileDisplayName(org.openide.filesystems.FileObject).
getDisplayName in class AbstractFileSystempublic void setRootDirectory(java.io.File r)
throws java.beans.PropertyVetoException,
java.io.IOException
r - file to set root tojava.beans.PropertyVetoException - if the value if vetoed by someone else (usually
by the Repository)java.io.IOException - if the root does not exists or some other error occuredpublic java.io.File getRootDirectory()
public void setReadOnly(boolean flag)
flag - true if it shouldpublic boolean isReadOnly()
FileSystemisReadOnly in class FileSystemprotected java.lang.String computeSystemName(java.io.File rootFile)
The default implementation simply returns the filename separated by slashes.
rootFile - root directory for the filesystemFileSystem.setSystemName(java.lang.String)protected java.lang.String[] children(java.lang.String name)
protected void createFolder(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionprotected void createData(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionprotected void rename(java.lang.String oldName,
java.lang.String newName)
throws java.io.IOException
java.io.IOExceptionprotected void delete(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionprotected java.util.Date lastModified(java.lang.String name)
protected boolean folder(java.lang.String name)
protected boolean readOnly(java.lang.String name)
protected java.lang.String mimeType(java.lang.String name)
protected long size(java.lang.String name)
protected java.io.InputStream inputStream(java.lang.String name)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionprotected java.io.OutputStream outputStream(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionprotected void lock(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionprotected void unlock(java.lang.String name)
protected void markUnimportant(java.lang.String name)
Built on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.