org.openide.filesystems
Class LocalFileSystem.Impl

java.lang.Object
  |
  +--org.openide.filesystems.LocalFileSystem.Impl
All Implemented Interfaces:
AbstractFileSystem.Change, AbstractFileSystem.Info, AbstractFileSystem.List, Serializable
Enclosing class:
LocalFileSystem

public static class LocalFileSystem.Impl
extends Object
implements AbstractFileSystem.List, AbstractFileSystem.Info, AbstractFileSystem.Change

The implementation class that implements List, Info and Change interfaces and delegates all the methods to appropriate methods of LocalFileSystem.

See Also:
Serialized Form

Fields inherited from interface org.openide.filesystems.AbstractFileSystem.List
serialVersionUID
 
Fields inherited from interface org.openide.filesystems.AbstractFileSystem.Info
serialVersionUID
 
Fields inherited from interface org.openide.filesystems.AbstractFileSystem.Change
serialVersionUID
 
Constructor Summary
LocalFileSystem.Impl(LocalFileSystem fs)
          Pointer to local file system
 
Method Summary
 String[] children(String name)
          Scans children for given name
 void createData(String name)
          Create new data file.
 void createFolder(String name)
          Creates new folder named name.
 void delete(String name)
          Delete the file.
 boolean folder(String name)
          Test if the file is folder or contains data.
 InputStream inputStream(String name)
          Get input stream.
 Date lastModified(String name)
          Get last modification time.
 void lock(String name)
          Does nothing to lock the file.
 void markUnimportant(String name)
          Does nothing to mark the file as 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.
 void rename(String oldName, String newName)
          Renames a file.
 long size(String name)
          Get the size of the file.
 void unlock(String name)
          Does nothing to unlock the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalFileSystem.Impl

public LocalFileSystem.Impl(LocalFileSystem fs)
Pointer to local file system
Parameters:
fs - the file system this impl is connected to
Method Detail

children

public String[] children(String name)
Scans children for given name
Specified by:
children in interface AbstractFileSystem.List
Following copied from interface: org.openide.filesystems.AbstractFileSystem.List
Parameters:
f - the folder, by name; e.g. top/next/afterthat
Returns:
a list of children of the folder, as file.ext (no path) the array can contain null values that will be ignored

createFolder

public void createFolder(String name)
                  throws IOException
Creates new folder named name.
Specified by:
createFolder in interface AbstractFileSystem.Change
Parameters:
name - name of folder
Throws:
IOException - if operation fails

createData

public void createData(String name)
                throws IOException
Create new data file.
Specified by:
createData in interface AbstractFileSystem.Change
Parameters:
name - name of the file
Returns:
the new data file object
Throws:
IOException - if the file cannot be created (e.g. already exists)

rename

public void rename(String oldName,
                   String newName)
            throws IOException
Renames a file.
Specified by:
rename in interface AbstractFileSystem.Change
Parameters:
oldName - old name of the file
newName - new name of the file

delete

public void delete(String name)
            throws IOException
Delete the file.
Specified by:
delete in interface AbstractFileSystem.Change
Parameters:
name - name of file
Throws:
IOException - if the file could not be deleted

lastModified

public Date lastModified(String name)
Get last modification time.
Specified by:
lastModified in interface AbstractFileSystem.Info
Parameters:
name - the file to test
Returns:
the date

folder

public boolean folder(String name)
Test if the file is folder or contains data.
Specified by:
folder in interface AbstractFileSystem.Info
Parameters:
name - name of the file
Returns:
true if the file is folder, false otherwise

readOnly

public boolean readOnly(String name)
Test whether this file can be written to or not.
Specified by:
readOnly in interface AbstractFileSystem.Info
Parameters:
name - the file to test
Returns:
true if file is read-only

mimeType

public String mimeType(String name)
Get the MIME type of the file. Uses FileUtil.getMIMEType(java.lang.String).
Specified by:
mimeType in interface AbstractFileSystem.Info
Parameters:
name - the file to test
Returns:
the MIME type textual representation, e.g. "text/plain"

size

public long size(String name)
Get the size of the file.
Specified by:
size in interface AbstractFileSystem.Info
Parameters:
name - the file to test
Returns:
the size of the file in bytes or zero if the file does not contain data (does not exist or is a folder).

inputStream

public InputStream inputStream(String name)
                        throws FileNotFoundException
Get input stream.
Specified by:
inputStream in interface AbstractFileSystem.Info
Parameters:
name - the file to test
Returns:
an input stream to read the contents of this file
Throws:
FileNotFoundException - if the file does not exists or is invalid

outputStream

public OutputStream outputStream(String name)
                          throws IOException
Get output stream.
Specified by:
outputStream in interface AbstractFileSystem.Info
Parameters:
name - the file to test
Returns:
output stream to overwrite the contents of this file
Throws:
IOException - if an error occures (the file is invalid, etc.)

lock

public void lock(String name)
          throws IOException
Does nothing to lock the file.
Specified by:
lock in interface AbstractFileSystem.Info
Parameters:
name - name of the file

unlock

public void unlock(String name)
Does nothing to unlock the file.
Specified by:
unlock in interface AbstractFileSystem.Info
Parameters:
name - name of the file

markUnimportant

public void markUnimportant(String name)
Does nothing to mark the file as unimportant.
Specified by:
markUnimportant in interface AbstractFileSystem.Info
Parameters:
name - the file to mark


Built on February 22 2001.  |  Portions Copyright 1997-2000 Sun Microsystems, Inc. All rights reserved.