Package org.eclipse.core.filesystem.provider

# Class FileSystem

java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.core.filesystem.provider.FileSystem

All Implemented Interfaces:
  `IFileSystem`, `IAdaptable`

public abstract class FileSystem extends PlatformObject implements IFileSystem
The common superclass for all file system implementations. Instances of this class are provided using the `org.eclipse.core.filesystem.filesystems` extension point.

On creation, the `setInitializationData` method is called with any parameter data specified in the declaring plug-in's manifest.

Clients may subclass this class.

Since:
  org.eclipse.core.filesystem 1.0

## Constructor Summary

Constructors
Constructor
Description
`FileSystem()`
Creates a new file system instance.

## Method Summary

Modifier and Type
Method
Description
`int`
`attributes()`
This is the default implementation of `IFileSystem.attributes()`.
`boolean`
`canDelete()`
This is the default implementation of `IFileSystem.canDelete()`.
`boolean`
`canWrite()`
This is the default implementation of `IFileSystem.canWrite()`.
`IFileTree`
`fetchFileTree(IFileStore root, IProgressMonitor monitor)`
Returns a file tree containing information about the complete sub-tree rooted at the given store.
`IFileStore`
`fromLocalFile(File file)`
Returns the file store in this file system corresponding to the given local file.
`final String`
`getScheme()`
Returns the URI scheme of this file system.
`abstract IFileStore`
`getStore(URI uri)`
Subclasses must implement this method to satisfy the contract of `IFileSystem.getStore(URI)`.
`IFileStore`
`getStore(IPath path)`
This is the default implementation of `IFileSystem.getStore(IPath)`.
`final void`
`initialize(String aScheme)`
Initializes this file system instance with the provided scheme.
`boolean`
`isCaseSensitive()`
This is the default implementation of `IFileSystem.isCaseSensitive()`.

### Methods inherited from class org.eclipse.core.runtime.PlatformObject

`getAdapter`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.core.runtime.IAdaptable

`getAdapter`

## Constructor Details

### FileSystem

public FileSystem()
Creates a new file system instance.

## Method Details

### attributes

public int attributes()
This is the default implementation of `IFileSystem.attributes()`. This implementation always returns `0`. Subclasses may override this method.

Specified by:
  `attributes` in interface `IFileSystem`
Returns:
  The attributes supported by this file system
See Also:
  - `IFileSystem.attributes()`

### canDelete

public boolean canDelete()
This is the default implementation of `IFileSystem.canDelete()`. This implementation always returns `false`. Subclasses may override this method.

Specified by:
  `canDelete` in interface `IFileSystem`
Returns:
  `true` if this file system supports deletion, and `false` otherwise.
See Also:
  - `IFileSystem.canDelete()`

### canWrite

public boolean canWrite()
This is the default implementation of `IFileSystem.canWrite()`. This implementation always returns `false`. Subclasses may override this method.

Specified by:
  `canWrite` in interface `IFileSystem`
Returns:
  `true` if this file system allows modification, and `false` otherwise.
See Also:
  - `IFileSystem.canWrite()`

### getScheme

public final String getScheme()
Description copied from interface: `IFileSystem`
Returns the URI scheme of this file system.

Specified by:
  `getScheme` in interface `IFileSystem`
Returns:
  the URI scheme of this file system.

### getStore

public IFileStore getStore(IPath path)
This is the default implementation of `IFileSystem.getStore(IPath)`. This implementation forwards to `IFileSystem.getStore(URI)`, assuming that the provided path corresponds to the path component of the URI for the file store.

Subclasses may override this method. If it is not possible to create a file store corresponding to the provided path for this file system, a file store belonging to the null file system should be returned

Specified by:
  `getStore` in interface `IFileSystem`
Parameters:
  `path` - A path to a file store within the scheme of this file system.
Returns:
  A handle to a file store in this file system
See Also:
  - `IFileSystem.getStore(IPath)`
  - `EFS.getNullFileSystem()`

### getStore

public abstract IFileStore getStore(URI uri)
Subclasses must implement this method to satisfy the contract of `IFileSystem.getStore(URI)`. If it is not possible to create a file store corresponding to the provided URI for this file system, a file store belonging to the null file system should be returned

Specified by:
  `getStore` in interface `IFileSystem`
Parameters:
  `uri` - The URI of the file store to return.
Returns:
  A handle to a file store in this file system

### fetchFileTree

public IFileTree fetchFileTree(IFileStore root, IProgressMonitor monitor) throws CoreException
Returns a file tree containing information about the complete sub-tree rooted at the given store. Returns `null` if this file system does not support the creation of such file trees.

A file tree accurately represents the state of a portion of a file system at the time it is created, but it is never updated. Clients using a file tree must tolerate the fact that the actual file system contents may change after the tree is generated.

This default implementation always returns `null`. Subclasses that can efficiently provide an `IFileTree` rooted at the given file store should override.

Specified by:
  `fetchFileTree` in interface `IFileSystem`
Parameters:
  `root` - The store to use as the root of the file tree
  `monitor` - a progress monitor, or `null` if progress reporting and cancellation are not desired
Returns:
  an `IFileTree` containing the sub-tree of the given store, or `null`
Throws:
  `CoreException` - if fails.
See Also:
  - `IFileSystem.fetchFileTree(IFileStore, IProgressMonitor)`

### fromLocalFile

public IFileStore fromLocalFile(File file)
Returns the file store in this file system corresponding to the given local file. Returns `null` if this file system cannot provide an `IFileStore` corresponding to a local file.

This default implementation always returns `null`. Subclasses may override to provide a concrete mapping from local files to an IFileStore in their file system.

Specified by:
  `fromLocalFile` in interface `IFileSystem`
Parameters:
  `file` - The file to be converted
Returns:
  The `IFileStore` corresponding to the given file, or `null`
See Also:
  - `IFileStore.toLocalFile(int, IProgressMonitor)`

### initialize

public final void initialize(String aScheme)
Initializes this file system instance with the provided scheme.

This method is called by the platform immediately after the file system instance is created. This method must not be called by clients.

Parameters:
  `aScheme` - The scheme of the file system.

### isCaseSensitive

public boolean isCaseSensitive()
This is the default implementation of `IFileSystem.isCaseSensitive()`. This implementation always returns `true`. Subclasses may override this method.

Specified by:
  `isCaseSensitive` in interface `IFileSystem`
Returns:
  `true` if this file system is case sensitive, and `false` otherwise.
See Also:
  - `IFileSystem.isCaseSensitive()`