org.openide.filesystems
Interface AbstractFileSystem.Info

All Superinterfaces:
Serializable
All Known Implementing Classes:
JarFileSystem.Impl, LocalFileSystem.Impl, XMLFileSystem.Impl
Enclosing interface:
AbstractFileSystem

public static interface AbstractFileSystem.Info
extends Serializable

Information about files.


Field Summary
static long serialVersionUID
          Deprecated. Only public by accident.
 
Method Summary
 boolean folder(String name)
          Test if the file is a folder or contains data.
 InputStream inputStream(String name)
          Get input stream.
 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.
 long size(String name)
          Get the size of the file.
 void unlock(String name)
          Unlock the file.
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Deprecated. Only public by accident.

See Also:
Constant Field Values
Method Detail

lastModified

public Date lastModified(String name)
Get last modification time.

Parameters:
name - the file to test
Returns:
the date of last modification

folder

public boolean folder(String name)
Test if the file is a folder or contains data.

Parameters:
name - name of the file
Returns:
true if the file is folder, false if it is data

readOnly

public boolean readOnly(String name)
Test whether this file can be written to or not.

Parameters:
name - the file to test
Returns:
true if the file is read-only

mimeType

public String mimeType(String name)
Get the MIME type of the file. If filesystem has no special support for MIME types then can simply return null. FileSystem can register MIME types for a well-known extensions: FileUtil.setMIMEType(String ext, String mimeType) or together with filesystem supply some resolvers subclassed from MIMEResolver.

Parameters:
name - the file to test
Returns:
the MIME type textual representation (e.g. "text/plain") or null if no special support for recognizing MIME is implemented.

size

public long size(String name)
Get the size of the file.

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.

Parameters:
name - the file to test
Returns:
an input stream to read the contents of this file
Throws:
FileNotFoundException - if the file does not exist or is invalid

outputStream

public OutputStream outputStream(String name)
                          throws IOException
Get output stream.

Parameters:
name - the file to test
Returns:
output stream to overwrite the contents of this file
Throws:
IOException - if an error occurs (the file is invalid, etc.)

lock

public void lock(String name)
          throws IOException
Lock the file. May do nothing if the underlying storage does not support locking. This does not affect locking using FileLock within the IDE, however.

Parameters:
name - name of the file
Throws:
FileAlreadyLockedException - if the file is already locked
IOException

unlock

public void unlock(String name)
Unlock the file.

Parameters:
name - name of the file

markUnimportant

public void markUnimportant(String name)
Mark the file as being unimportant. If not called, the file is assumed to be important. Deprecated and new implementations need not do anything.

Parameters:
name - the file to mark

 

Built on May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.