|
org.openide.filesystems 6.4.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.filesystems.FileSystem org.openide.filesystems.AbstractFileSystem org.openide.filesystems.LocalFileSystem
public class LocalFileSystem
Local filesystem. Provides access to files on local disk.
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.
Nested Class Summary | |
---|---|
static class |
LocalFileSystem.Impl
The implementation class that implements List, Info and Change interfaces and delegates all the methods to appropriate methods of LocalFileSystem. |
Nested classes/interfaces inherited from class org.openide.filesystems.AbstractFileSystem |
---|
AbstractFileSystem.Attr, AbstractFileSystem.Change, AbstractFileSystem.Info, AbstractFileSystem.List, AbstractFileSystem.Transfer |
Nested classes/interfaces inherited from class org.openide.filesystems.FileSystem |
---|
FileSystem.AtomicAction, FileSystem.Environment, FileSystem.HtmlStatus, FileSystem.Status |
Field Summary |
---|
Fields inherited from class org.openide.filesystems.AbstractFileSystem |
---|
attr, change, info, list, transfer |
Fields inherited from class org.openide.filesystems.FileSystem |
---|
PROP_DISPLAY_NAME, PROP_HIDDEN, PROP_READ_ONLY, PROP_ROOT, PROP_SYSTEM_NAME, PROP_VALID |
Constructor Summary | |
---|---|
LocalFileSystem()
Constructor. |
|
LocalFileSystem(FileSystemCapability cap)
Deprecated. Useless. |
Method Summary | |
---|---|
protected String[] |
children(String name)
|
protected String |
computeSystemName(File rootFile)
Compute the system name of this filesystem for a given root directory. |
protected void |
createData(String name)
|
protected void |
createFolder(String name)
|
protected void |
delete(String name)
|
protected boolean |
folder(String name)
|
String |
getDisplayName()
Provides a name for the system that can be presented to the user. |
File |
getRootDirectory()
Get the root directory of the filesystem. |
protected InputStream |
inputStream(String name)
|
boolean |
isReadOnly()
Test if the filesystem is read-only or not. |
protected Date |
lastModified(String name)
|
protected void |
lock(String name)
|
protected void |
markUnimportant(String name)
|
protected String |
mimeType(String name)
|
protected OutputStream |
outputStream(String name)
|
void |
prepareEnvironment(FileSystem.Environment environment)
Deprecated. Useless. |
protected boolean |
readOnly(String name)
|
protected void |
rename(String oldName,
String newName)
|
void |
setReadOnly(boolean flag)
Set whether the filesystem should be read only. |
void |
setRootDirectory(File r)
Set the root directory of the filesystem. |
protected long |
size(String name)
|
protected void |
unlock(String name)
|
Methods inherited from class org.openide.filesystems.AbstractFileSystem |
---|
canRead, canWrite, checkVirtual, createReference, existingFileObjects, find, findReference, findResource, getActions, getRefreshTime, getRoot, markImportant, refresh, refreshResource, refreshRoot, setRefreshTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LocalFileSystem()
public LocalFileSystem(FileSystemCapability cap)
cap
- capabilities for this filesystemMethod Detail |
---|
public 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 AbstractFileSystem
public void setRootDirectory(File r) throws PropertyVetoException, IOException
r
- file to set root to
PropertyVetoException
- if the value if vetoed by someone else (usually
by the Repository
)
IOException
- if the root does not exists or some other error occuredpublic File getRootDirectory()
public void setReadOnly(boolean flag)
flag
- true
if it shouldpublic boolean isReadOnly()
FileSystem
isReadOnly
in class FileSystem
public void prepareEnvironment(FileSystem.Environment environment)
prepareEnvironment
in class FileSystem
environment
- the environment to add toprotected String computeSystemName(File rootFile)
The default implementation simply returns the filename separated by slashes.
rootFile
- root directory for the filesystem
FileSystem.setSystemName(java.lang.String)
protected String[] children(String name)
protected void createFolder(String name) throws IOException
IOException
protected void createData(String name) throws IOException
IOException
protected void rename(String oldName, String newName) throws IOException
IOException
protected void delete(String name) throws IOException
IOException
protected Date lastModified(String name)
protected boolean folder(String name)
protected boolean readOnly(String name)
protected String mimeType(String name)
protected long size(String name)
protected InputStream inputStream(String name) throws FileNotFoundException
FileNotFoundException
protected OutputStream outputStream(String name) throws IOException
IOException
protected void lock(String name) throws IOException
IOException
protected void unlock(String name)
protected void markUnimportant(String name)
|
org.openide.filesystems 6.4.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |