Package org.eclipse.core.filebuffers
Class FileBuffers
- java.lang.Object
-
- org.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. UseITextFileBufferManager.DEFAULTto get the default text file buffer manager.- Since:
- 3.0
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ITextFileBufferManagercreateTextFileBufferManager()Creates and returns an unshared text file buffer manager.static IFileStoregetFileStoreAtLocation(IPath location)Returns the file in the local file system for the given location.static FilegetSystemFileAtLocation(IPath location)Deprecated.As of 3.2, replaced bygetFileStoreAtLocation(IPath)static ITextFileBufferManagergetTextFileBufferManager()Returns the text file buffer manager.static IFilegetWorkspaceFileAtLocation(IPath location)Returns the workspace file at the given location if such a file exists.static IFilegetWorkspaceFileAtLocation(IPath location, boolean isNormalized)Returns the workspace file at the given location if such a file exists.static IPathnormalizeLocation(IPath pathOrLocation)Returns the normalized form of the given path or location.
-
-
-
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 returnnullif the file buffers plug-in is not active. This is, for example, the case when the method is called on plug-in shutdown.Use
ITextFileBufferManager.DEFAULTto get the default text file buffer manager if you do not want to depend onorg.eclipse.core.resources.- Returns:
- the text file buffer manager or
null
-
createTextFileBufferManager
public static ITextFileBufferManager createTextFileBufferManager()
Creates and returns an unshared text file buffer manager.- Returns:
- the text file buffer manager or
null - Since:
- 3.4
-
getWorkspaceFileAtLocation
public static IFile getWorkspaceFileAtLocation(IPath location)
Returns the workspace file at the given location if such a file exists.- Parameters:
location- the location- Returns:
- the workspace file at the location or
nullif no such file exists or if the location is not a valid location
-
getWorkspaceFileAtLocation
public static IFile getWorkspaceFileAtLocation(IPath location, boolean isNormalized)
Returns the workspace file at the given location if such a file exists.- Parameters:
location- the locationisNormalized-trueif the given location is already normalized- Returns:
- the workspace file at the location or
nullif no such file exists or if the location is not a valid location - 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:
- Existing Workspace Files: For a path or location for
which there
existsa workspace file, the normalized form is that file's workspace relative, absolute path as returned byIFile.getFullPath(). - Non-existing Workspace Files: For a path to a
non-existing workspace file, the normalized form is the
absoluteform of the path. - External Files: For a location for which there
exists no workspace file, the normalized form is the
absoluteform of the location.
- Parameters:
pathOrLocation- the path or location to be normalized- Returns:
- the normalized form of
pathOrLocation
- Existing Workspace Files: For a path or location for
which there
-
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
IFileStorein the local file system for the given location - Since:
- 3.2
-
getSystemFileAtLocation
@Deprecated public static File getSystemFileAtLocation(IPath location)
Deprecated.As of 3.2, replaced bygetFileStoreAtLocation(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
Filein the local file system for the given location
-
-