Eclipse Platform
Release 3.2

org.eclipse.core.filesystem
Class EFS

java.lang.Object
  extended byorg.eclipse.core.filesystem.EFS

public class EFS
extends Object

This class is the main entry point for clients of the Eclipse file system API. This class has factory methods for obtaining instances of file systems and file stores, and provides constants for option values and error codes.

This class is not intended to be instantiated or subclassed.

Since:
org.eclipse.core.filesystem 1.0

Field Summary
static int APPEND
          Option flag constant (value 1 <<0) indicating a file opened for appending data to the end.
static int ATTRIBUTE_ARCHIVE
          Attribute constant (value 1 <<3) indicating that a file is an archive.
static int ATTRIBUTE_EXECUTABLE
          Attribute constant (value 1 <<2) indicating that a file is a executable.
static int ATTRIBUTE_HIDDEN
          Attribute constant (value 1 <<4) indicating that a file is hidden.
static int ATTRIBUTE_READ_ONLY
          Attribute constant (value 1 <<1) indicating that a file is read only.
static int CACHE
          Option flag constant (value 1 <<12) indicating that a cached representation of a file should be returned.
static int ERROR_CASE_VARIANT_EXISTS
          Status code constant (value 275) indicating this file system is not case sensitive and a file that differs only in case unexpectedly exists on the file system.
static int ERROR_DELETE
          Status code constant (value 273) indicating an error occurred while deleting from the file system.
static int ERROR_EXISTS
          Status code constant (value 268) indicating a store unexpectedly exists on the file system.
static int ERROR_INTERNAL
          Status code constant (value 566) indicating an error internal has occurred.
static int ERROR_NO_LOCATION
          Status code constant (value 270) indicating the file system location for a store could not be computed.
static int ERROR_NOT_EXISTS
          Status code constant (value 269) indicating a store unexpectedly does not exist on the file system.
static int ERROR_PARENT_READ_ONLY
          Status code constant (value 277) indicating that the parent file in the file system is marked as read-only.
static int ERROR_READ
          Status code constant (value 271) indicating an error occurred while reading from the file system.
static int ERROR_READ_ONLY
          Status code constant (value 279) indicating that the file in the file system is marked as read-only.
static int ERROR_WRITE
          Status code constant (value 272) indicating an error occurred while writing to the file system.
static int ERROR_WRONG_TYPE
          Status code constant (value 276) indicating a file exists in the file system but is not of the expected type (file instead of directory, or vice-versa).
static int NONE
          A constant known to be zero (0), used in operations which take bit flags to indicate that "no bits are set".
static int OVERWRITE
          Option flag constant (value 1 <<1) indicating that existing files may be overwritten.
static String PI_FILE_SYSTEM
          The unique identifier constant (value "org.eclipse.core.filesystem") of the Core file system plug-in.
static String PT_FILE_SYSTEMS
          The simple identifier constant (value "filesystems") of the extension point of the Core file system plug-in where plug-ins declare file system implementations.
static String SCHEME_FILE
          Scheme constant (value "file") indicating the local file system scheme.
static String SCHEME_NULL
          Scheme constant (value "null") indicating the null file system scheme.
static int SET_ATTRIBUTES
          Option flag constant (value 1 <<10) indicating that a file's attributes should be updated.
static int SET_LAST_MODIFIED
          Option flag constant (value 1 <<11) indicating that a file's last modified time should be updated.
static int SHALLOW
          Option flag constant (value 1 <<2) indicating that an operation acts on a single file or directory, and not its parents or children.
 
Method Summary
static IFileInfo createFileInfo()
          Creates an empty file information object.
static IFileSystem getFileSystem(String scheme)
          Returns a file system corresponding to the given scheme.
static IFileSystem getLocalFileSystem()
          Returns the local file system.
static IFileSystem getNullFileSystem()
          Returns the null file system.
static IFileStore getStore(URI uri)
          Returns the file store corresponding to the provided URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PI_FILE_SYSTEM

public static final String PI_FILE_SYSTEM
The unique identifier constant (value "org.eclipse.core.filesystem") of the Core file system plug-in.

See Also:
Constant Field Values

PT_FILE_SYSTEMS

public static final String PT_FILE_SYSTEMS
The simple identifier constant (value "filesystems") of the extension point of the Core file system plug-in where plug-ins declare file system implementations.

See Also:
Constant Field Values

NONE

public static final int NONE
A constant known to be zero (0), used in operations which take bit flags to indicate that "no bits are set". This value is also used as a default value in cases where a file system attribute cannot be computed.

See Also:
IFileInfo.getLength(), IFileInfo.getLastModified(), Constant Field Values

APPEND

public static final int APPEND
Option flag constant (value 1 <<0) indicating a file opened for appending data to the end.

See Also:
IFileStore.openOutputStream(int, IProgressMonitor), Constant Field Values

OVERWRITE

public static final int OVERWRITE
Option flag constant (value 1 <<1) indicating that existing files may be overwritten.

See Also:
IFileStore.copy(IFileStore, int, IProgressMonitor), IFileStore.move(IFileStore, int, IProgressMonitor), Constant Field Values

SHALLOW

public static final int SHALLOW
Option flag constant (value 1 <<2) indicating that an operation acts on a single file or directory, and not its parents or children.

See Also:
IFileStore.copy(IFileStore, int, IProgressMonitor), IFileStore.mkdir(int, IProgressMonitor), Constant Field Values

SET_ATTRIBUTES

public static final int SET_ATTRIBUTES
Option flag constant (value 1 <<10) indicating that a file's attributes should be updated.

See Also:
IFileStore.putInfo(IFileInfo, int, IProgressMonitor), Constant Field Values

SET_LAST_MODIFIED

public static final int SET_LAST_MODIFIED
Option flag constant (value 1 <<11) indicating that a file's last modified time should be updated.

See Also:
IFileStore.putInfo(IFileInfo, int, IProgressMonitor), Constant Field Values

CACHE

public static final int CACHE
Option flag constant (value 1 <<12) indicating that a cached representation of a file should be returned.

See Also:
IFileStore.toLocalFile(int, IProgressMonitor), Constant Field Values

ATTRIBUTE_READ_ONLY

public static final int ATTRIBUTE_READ_ONLY
Attribute constant (value 1 <<1) indicating that a file is read only.

See Also:
IFileStore.fetchInfo(), IFileStore.putInfo(IFileInfo, int, IProgressMonitor), IFileInfo.getAttribute(int), IFileInfo.setAttribute(int, boolean), Constant Field Values

ATTRIBUTE_EXECUTABLE

public static final int ATTRIBUTE_EXECUTABLE
Attribute constant (value 1 <<2) indicating that a file is a executable.

See Also:
IFileStore.fetchInfo(), IFileStore.putInfo(IFileInfo, int, IProgressMonitor), IFileInfo.getAttribute(int), IFileInfo.setAttribute(int, boolean), Constant Field Values

ATTRIBUTE_ARCHIVE

public static final int ATTRIBUTE_ARCHIVE
Attribute constant (value 1 <<3) indicating that a file is an archive.

See Also:
IFileStore.fetchInfo(), IFileStore.putInfo(IFileInfo, int, IProgressMonitor), IFileInfo.getAttribute(int), IFileInfo.setAttribute(int, boolean), Constant Field Values

ATTRIBUTE_HIDDEN

public static final int ATTRIBUTE_HIDDEN
Attribute constant (value 1 <<4) indicating that a file is hidden.

See Also:
IFileStore.fetchInfo(), IFileStore.putInfo(IFileInfo, int, IProgressMonitor), IFileInfo.getAttribute(int), IFileInfo.setAttribute(int, boolean), Constant Field Values

SCHEME_FILE

public static final String SCHEME_FILE
Scheme constant (value "file") indicating the local file system scheme.

See Also:
getLocalFileSystem(), Constant Field Values

SCHEME_NULL

public static final String SCHEME_NULL
Scheme constant (value "null") indicating the null file system scheme.

See Also:
getNullFileSystem(), Constant Field Values

ERROR_EXISTS

public static final int ERROR_EXISTS
Status code constant (value 268) indicating a store unexpectedly exists on the file system. Severity: error. Category: file system.

See Also:
Constant Field Values

ERROR_NOT_EXISTS

public static final int ERROR_NOT_EXISTS
Status code constant (value 269) indicating a store unexpectedly does not exist on the file system. Severity: error. Category: file system.

See Also:
Constant Field Values

ERROR_NO_LOCATION

public static final int ERROR_NO_LOCATION
Status code constant (value 270) indicating the file system location for a store could not be computed. Severity: error. Category: file system.

See Also:
Constant Field Values

ERROR_READ

public static final int ERROR_READ
Status code constant (value 271) indicating an error occurred while reading from the file system. Severity: error. Category: file system.

See Also:
Constant Field Values

ERROR_WRITE

public static final int ERROR_WRITE
Status code constant (value 272) indicating an error occurred while writing to the file system. Severity: error. Category: file system.

See Also:
Constant Field Values

ERROR_DELETE

public static final int ERROR_DELETE
Status code constant (value 273) indicating an error occurred while deleting from the file system. Severity: error. Category: file system.

See Also:
Constant Field Values

ERROR_CASE_VARIANT_EXISTS

public static final int ERROR_CASE_VARIANT_EXISTS
Status code constant (value 275) indicating this file system is not case sensitive and a file that differs only in case unexpectedly exists on the file system. Severity: error. Category: file system.

See Also:
Constant Field Values

ERROR_WRONG_TYPE

public static final int ERROR_WRONG_TYPE
Status code constant (value 276) indicating a file exists in the file system but is not of the expected type (file instead of directory, or vice-versa). Severity: error. Category: file system.

See Also:
Constant Field Values

ERROR_PARENT_READ_ONLY

public static final int ERROR_PARENT_READ_ONLY
Status code constant (value 277) indicating that the parent file in the file system is marked as read-only. Severity: error. Category: file system.

See Also:
Constant Field Values

ERROR_READ_ONLY

public static final int ERROR_READ_ONLY
Status code constant (value 279) indicating that the file in the file system is marked as read-only. Severity: error. Category: file system.

See Also:
Constant Field Values

ERROR_INTERNAL

public static final int ERROR_INTERNAL
Status code constant (value 566) indicating an error internal has occurred. Severity: error. Category: internal.

See Also:
Constant Field Values
Method Detail

createFileInfo

public static IFileInfo createFileInfo()
Creates an empty file information object. The resulting information will represent a non-existent file with no name and no attributes set.

Returns:
an empty file information object.
See Also:
IFileStore.putInfo(IFileInfo, int, IProgressMonitor)

getFileSystem

public static IFileSystem getFileSystem(String scheme)
                                 throws CoreException
Returns a file system corresponding to the given scheme.

Parameters:
scheme - The file system URI scheme
Returns:
The corresponding file system for the given scheme
Throws:
CoreException - if this method fails. Reasons include:
  • There is no registered file system for the given URI scheme.
  • There was a failure initializing the file system.

getLocalFileSystem

public static IFileSystem getLocalFileSystem()
Returns the local file system.

Returns:
The local file system

getNullFileSystem

public static IFileSystem getNullFileSystem()
Returns the null file system. The null file system can be used to represent a non-existent or unresolved file system. An example of a null file system is a file system whose location is relative to an undefined variable, or a system whose scheme is unknown.

Basic handle-based queries can be performed on the null file system, but all operations that actually require file system access will fail.

Returns:
The null file system

getStore

public static IFileStore getStore(URI uri)
                           throws CoreException
Returns the file store corresponding to the provided URI.

Parameters:
uri - The URI of the file store to return
Returns:
The file store
Throws:
CoreException - if this method fails. Reasons include:
  • There is no registered file system for the given URI scheme.
  • The URI syntax was not in the appropriate form for that scheme.
  • There was a failure initializing the file system.

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.