|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openide.filesystems.FileSystem | +--org.openide.filesystems.AbstractFileSystem | +--org.openide.filesystems.LocalFileSystem
Local file system. Provides access to files on local disk.
Inner 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. |
Inner classes inherited from class org.openide.filesystems.AbstractFileSystem |
AbstractFileSystem.Attr, AbstractFileSystem.Change, AbstractFileSystem.Info, AbstractFileSystem.List, AbstractFileSystem.Transfer |
Inner classes inherited from class org.openide.filesystems.FileSystem |
FileSystem.AtomicAction, FileSystem.Environment, FileSystem.Status |
Fields inherited from class org.openide.filesystems.AbstractFileSystem |
attr, change, info, list, transfer |
Fields inherited from class org.openide.filesystems.FileSystem |
PROP_HIDDEN, PROP_READ_ONLY, PROP_ROOT, PROP_SYSTEM_NAME, PROP_VALID |
Constructor Summary | |
LocalFileSystem()
Constructor. |
|
LocalFileSystem(FileSystemCapability cap)
Constructor. |
Method Summary | |
protected String[] |
children(String name)
Scans children for given name |
protected String |
computeSystemName(File rootFile)
Compute the system name of this file system for a given root directory. |
protected void |
createData(String name)
Create new data file. |
protected void |
createFolder(String name)
Creates new folder named name. |
protected void |
delete(String name)
Delete the file. |
protected boolean |
folder(String name)
Test if the file is folder or contains data. |
String |
getDisplayName()
Provides a name for the system that can be presented to the user. |
File |
getRootDirectory()
Get the root directory of the file system. |
protected InputStream |
inputStream(String name)
Get input stream. |
boolean |
isReadOnly()
Test if the filesystem is read-only or not. |
protected Date |
lastModified(String name)
Get last modification time. |
protected void |
lock(String name)
Does nothing to lock the file. |
protected void |
markUnimportant(String name)
Does nothing to mark the file as unimportant. |
protected String |
mimeType(String name)
Get the MIME type of the file. |
protected OutputStream |
outputStream(String name)
Get output stream. |
void |
prepareEnvironment(FileSystem.Environment environment)
Prepare environment by adding the root directory of the file system to the class path. |
protected boolean |
readOnly(String name)
Test whether this file can be written to or not. |
protected void |
rename(String oldName,
String newName)
Renames a file. |
void |
setReadOnly(boolean flag)
Set whether the file system should be read only. |
void |
setRootDirectory(File r)
Set the root directory of the file system. |
protected long |
size(String name)
Get the size of the file. |
protected void |
unlock(String name)
Does nothing to unlock the file. |
Methods inherited from class org.openide.filesystems.AbstractFileSystem |
createReference, existingFileObjects, find, findReference, findResource, getActions, getRefreshTime, getRoot, refreshResource, refreshRoot, setRefreshTime |
Methods inherited from class org.openide.filesystems.FileSystem |
addFileStatusListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, fireFileStatusChanged, firePropertyChange, fireVetoableChange, getActions, getCapability, getStatus, getSystemName, isDefault, isHidden, isPersistent, isValid, removeFileStatusListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, runAtomicAction, setCapability, setHidden, setSystemName, toString |
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 file systemMethod Detail |
public String getDisplayName()
FileSystem
getDisplayName
in class AbstractFileSystem
org.openide.filesystems.FileSystem
public void setRootDirectory(File r) throws PropertyVetoException, IOException
r
- file to set root toPropertyVetoException
- 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
org.openide.filesystems.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 filesystemFileSystem.setSystemName(java.lang.String)
protected String[] children(String name)
protected void createFolder(String name) throws IOException
name
- name of folderIOException
- if operation failsprotected void createData(String name) throws IOException
name
- name of the fileIOException
- if the file cannot be created (e.g. already exists)protected void rename(String oldName, String newName) throws IOException
oldName
- old name of the filenewName
- new name of the fileprotected void delete(String name) throws IOException
name
- name of fileIOException
- if the file could not be deletedprotected Date lastModified(String name)
name
- the file to testprotected boolean folder(String name)
name
- name of the fileprotected boolean readOnly(String name)
name
- the file to testtrue
if file is read-onlyprotected String mimeType(String name)
name
- the file to test"text/plain"
)
or null if no special support for recognizing MIME is implemented.protected long size(String name)
name
- the file to testprotected InputStream inputStream(String name) throws FileNotFoundException
name
- the file to testFileNotFoundException
- if the file does not exists or is invalidprotected OutputStream outputStream(String name) throws IOException
name
- the file to testIOException
- if an error occures (the file is invalid, etc.)protected void lock(String name) throws IOException
name
- name of the fileprotected void unlock(String name)
name
- name of the fileprotected void markUnimportant(String name)
name
- the file to mark
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |