Eclipse Platform
Release 3.3

org.eclipse.core.filebuffers
Class FileBuffers

java.lang.Object
  extended byorg.eclipse.core.filebuffers.FileBuffers

public final class FileBuffers
extends Object

Facade for the file buffers plug-in. Provides access to the text file buffer manager and helper methods for location handling. This facade is available independent from the activation status of the file buffers plug-in.

This class must not be used by clients that do not want to require org.eclipse.core.resources. Use ITextFileBufferManager.DEFAULT to get the default text file buffer manager.

Since:
3.0

Field Summary
static String PLUGIN_ID
          File buffer plug-in ID (value "org.eclipse.core.filebuffers").
 
Method Summary
static IFileStore getFileStoreAtLocation(IPath location)
          Returns the file in the local file system for the given location.
static File getSystemFileAtLocation(IPath location)
          Deprecated. As of 3.2, replaced by getFileStoreAtLocation(IPath)
static ITextFileBufferManager getTextFileBufferManager()
          Returns the text file buffer manager.
static IFile getWorkspaceFileAtLocation(IPath location)
          Returns the workspace file at the given location or null if the location is not a valid location in the workspace.
static IFile getWorkspaceFileAtLocation(IPath location, boolean isNormalized)
          Returns the workspace file at the given location or null if the location is not a valid location in the workspace.
static IPath normalizeLocation(IPath pathOrLocation)
          Returns the normalized form of the given path or location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLUGIN_ID

public static final String PLUGIN_ID
File buffer plug-in ID (value "org.eclipse.core.filebuffers").

Since:
3.3.
See Also:
Constant Field Values
Method Detail

getTextFileBufferManager

public static ITextFileBufferManager getTextFileBufferManager()
Returns the text file buffer manager. May return null if the file buffers plug-in may no be activated. This is, for example, the case when the method is called on plug-in shutdown.

Use ITextFileBufferManager.DEFAULT to get the default text file buffer manager if you do not want to depend on org.eclipse.core.resources.

Returns:
the text file buffer manager or null

getWorkspaceFileAtLocation

public static IFile getWorkspaceFileAtLocation(IPath location)
Returns the workspace file at the given location or null if the location is not a valid location in the workspace.

Parameters:
location - the location
Returns:
the workspace file at the location or null

getWorkspaceFileAtLocation

public static IFile getWorkspaceFileAtLocation(IPath location,
                                               boolean isNormalized)
Returns the workspace file at the given location or null if the location is not a valid location in the workspace.

Parameters:
location - the location
isNormalized - true if the given location is already normalized
Returns:
the workspace file at the location or null
Since:
3.3

normalizeLocation

public static IPath normalizeLocation(IPath pathOrLocation)
Returns the normalized form of the given path or location.

The normalized form is defined as follows:

Parameters:
pathOrLocation - the path or location to be normalized
Returns:
the normalized form of pathOrLocation

getFileStoreAtLocation

public static IFileStore getFileStoreAtLocation(IPath location)
Returns the file in the local file system for the given location.

The location is either a full path of a workspace resource or an absolute path in the local file system.

Parameters:
location - the location
Returns:
the IFileStore in the local file system for the given location
Since:
3.2

getSystemFileAtLocation

public static File getSystemFileAtLocation(IPath location)
Deprecated. As of 3.2, replaced by getFileStoreAtLocation(IPath)

Returns the file in the local file system for the given location.

The location is either a full path of a workspace resource or an absolute path in the local file system.

Parameters:
location - the location
Returns:
the File in the local file system for the given location

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

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