Interface IFileSystem

All Superinterfaces:
IAdaptable
All Known Implementing Classes:
FileSystem

public interface IFileSystem extends IAdaptable
This is the main interface to a single file system. Each file system instance manages interaction with all files in the backing store represented by a particular URI scheme.

File systems are registered using the "filesystems" extension point.

Since:
org.eclipse.core.filesystem 1.0
See Also:
Restriction:
This interface is not intended to be implemented by clients. File system implementations must subclass FileSystem rather than implementing this interface directly.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the file attributes supported by this file system.
    boolean
    Returns whether this file system supports deletion
    boolean
    Returns whether this file system supports modification.
    Returns a file tree containing information about the complete sub-tree rooted at the given store.
    Returns the file store in this file system corresponding to the given local file.
    Returns the URI scheme of this file system.
    Returns a handle to a file store in this file system.
    Returns a handle to a file store in this file system.
    boolean
    Returns whether this file system is case sensitive.

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

    getAdapter
  • Method Details

    • attributes

      int attributes()
      Returns the file attributes supported by this file system. This value is a bit mask of the EFS.ATTRIBUTE_* constants.
      Returns:
      the file attributes supported by this file system.
    • canDelete

      boolean canDelete()
      Returns whether this file system supports deletion
      Returns:
      true if this file system allows deletion of files and directories, and false otherwise
    • canWrite

      boolean canWrite()
      Returns whether this file system supports modification.
      Returns:
      true if this file system allows modification of files and directories, and false otherwise
    • fetchFileTree

      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.

      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 this method fails. Reasons include:
      • Problems occurred while contacting the file system.
      See Also:
    • fromLocalFile

      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.
      Parameters:
      file - The file to be converted
      Returns:
      The IFileStore corresponding to the given file, or null
      See Also:
    • getScheme

      String getScheme()
      Returns the URI scheme of this file system.
      Returns:
      the URI scheme of this file system.
    • getStore

      IFileStore getStore(IPath path)
      Returns a handle to a file store in this file system. This is a handle-only method; this method succeeds regardless of whether a file exists at that path in this file system.

      This is a convenience method for file systems that do not make use of the authority URI component, such as a host or user information. The provided path argument is interpreted as the path component of the file system's URI. For example, this method can be used to safely navigate within the local file system.

      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:
    • getStore

      IFileStore getStore(URI uri)
      Returns a handle to a file store in this file system. This is a handle-only method; this method succeeds regardless of whether a file exists at that path in this file system. The provided URI must have the appropriate scheme and component parts for the file system on which this method is called.
      Parameters:
      uri - The URI of the file store to return.
      Returns:
      A handle to a file store in this file system
    • isCaseSensitive

      boolean isCaseSensitive()
      Returns whether this file system is case sensitive. A case sensitive file system treats files with names that differ only in case as different files. For example, "HELLO", "Hello", and "hello" would be three different files or directories in a case sensitive file system.
      Returns:
      true if this file system is case sensitive, and false otherwise.