org.eclipse.core.internal.resources
Class LocalMetaArea

java.lang.Object
  extended by org.eclipse.core.internal.resources.LocalMetaArea
All Implemented Interfaces:
ICoreConstants

public class LocalMetaArea
extends java.lang.Object
implements ICoreConstants


Field Summary
 
Fields inherited from interface org.eclipse.core.internal.resources.ICoreConstants
CRASH_DETECTED, EMPTY_FILE_STATES, EMPTY_PROJECT_ARRAY, EMPTY_RESOURCE_ARRAY, I_NULL_SYNC_INFO, K_BUILD_LIST, M_CHILDREN_UNKNOWN, M_CONTENT_CACHE, M_DEFAULT_CONTENT_DESCRIPTION, M_DERIVED, M_HIDDEN, M_LINK, M_LOCAL_EXISTS, M_MARKERS_SNAP_DIRTY, M_NO_CONTENT_DESCRIPTION, M_OPEN, M_PHANTOM, M_SYNCINFO_SNAP_DIRTY, M_TEAM_PRIVATE_MEMBER, M_TYPE, M_TYPE_START, M_USED, MINIMUM_FILE_SEGMENT_LENGTH, MINIMUM_FOLDER_SEGMENT_LENGTH, NULL_FLAG, PREF_VERSION, PREF_VERSION_KEY, PROJECT_SEGMENT_LENGTH, REFRESH_ON_STARTUP, WORKSPACE_TREE_VERSION_1, WORKSPACE_TREE_VERSION_2
 
Constructor Summary
LocalMetaArea()
           
 
Method Summary
 void clearOldDescription(IProject target)
          For backwards compatibility, if there is a project at the old project description location, delete it.
 void create(IProject target)
           
 void createMetaArea()
          Creates the meta area root directory.
 void delete(IProject target)
          The project is being deleted.
 org.eclipse.core.runtime.IPath getBackupLocationFor(org.eclipse.core.runtime.IPath file)
           
 org.eclipse.core.runtime.IPath getHistoryStoreLocation()
           
 org.eclipse.core.runtime.IPath getLocation()
          Returns the local file system location which contains the META data for the resources plugin (i.e., the entire workspace).
 org.eclipse.core.runtime.IPath getMarkersLocationFor(IResource resource)
          Returns the path of the file in which to save markers for the given resource.
 org.eclipse.core.runtime.IPath getMarkersSnapshotLocationFor(IResource resource)
          Returns the path of the file in which to snapshot markers for the given resource.
 org.eclipse.core.runtime.IPath getOldDescriptionLocationFor(IProject target)
          The project description file is the only metadata file stored outside the metadata area.
 org.eclipse.core.runtime.IPath getOldWorkspaceDescriptionLocation()
           
 org.eclipse.core.runtime.IPath getPropertyStoreLocation(IResource resource)
           
 org.eclipse.core.runtime.IPath getSafeTableLocationFor(java.lang.String pluginId)
           
 org.eclipse.core.runtime.IPath getSnapshotLocationFor(IResource resource)
           
 org.eclipse.core.runtime.IPath getSyncInfoLocationFor(IResource resource)
          Returns the path of the file in which to save the sync information for the given resource.
 org.eclipse.core.runtime.IPath getSyncInfoSnapshotLocationFor(IResource resource)
          Returns the path of the file in which to snapshot the sync information for the given resource.
 org.eclipse.core.runtime.IPath getTreeLocationFor(IResource target, boolean updateSequenceNumber)
          Returns the local file system location of the tree file for the given resource.
 org.eclipse.core.runtime.IPath getWorkingLocation(IResource resource, java.lang.String id)
           
 boolean hasSavedProject(IProject project)
           
 boolean hasSavedWorkspace()
           
 org.eclipse.core.runtime.IPath locationFor(org.eclipse.core.runtime.IPath resourcePath)
          Returns the local file system location in which the meta data for the resource with the given path is stored.
 org.eclipse.core.runtime.IPath locationFor(IResource resource)
          Returns the local file system location in which the meta data for the given resource is stored.
 ProjectDescription readOldDescription(IProject project)
          Reads and returns the project description for the given project.
 WorkspaceDescription readOldWorkspace()
          Provides backward compatibility with existing workspaces based on descriptions.
 void readPrivateDescription(IProject target, IProjectDescription description)
          Returns the portions of the project description that are private, and adds them to the supplied project description.
 void write(WorkspaceDescription description)
          Deprecated. should not be called any more - workspace preferences are now maintained in the plug-in's preferences
 void writePrivateDescription(IProject target)
          Write the private project description information, including the location and the dynamic project references.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalMetaArea

public LocalMetaArea()
Method Detail

clearOldDescription

public void clearOldDescription(IProject target)
For backwards compatibility, if there is a project at the old project description location, delete it.


create

public void create(IProject target)

createMetaArea

public void createMetaArea()
                    throws org.eclipse.core.runtime.CoreException
Creates the meta area root directory.

Throws:
org.eclipse.core.runtime.CoreException

delete

public void delete(IProject target)
            throws org.eclipse.core.runtime.CoreException
The project is being deleted. Delete all meta-data associated with the project.

Throws:
org.eclipse.core.runtime.CoreException

getBackupLocationFor

public org.eclipse.core.runtime.IPath getBackupLocationFor(org.eclipse.core.runtime.IPath file)

getHistoryStoreLocation

public org.eclipse.core.runtime.IPath getHistoryStoreLocation()

getLocation

public org.eclipse.core.runtime.IPath getLocation()
Returns the local file system location which contains the META data for the resources plugin (i.e., the entire workspace).


getMarkersLocationFor

public org.eclipse.core.runtime.IPath getMarkersLocationFor(IResource resource)
Returns the path of the file in which to save markers for the given resource. Should only be called for the workspace root and projects.


getMarkersSnapshotLocationFor

public org.eclipse.core.runtime.IPath getMarkersSnapshotLocationFor(IResource resource)
Returns the path of the file in which to snapshot markers for the given resource. Should only be called for the workspace root and projects.


getOldDescriptionLocationFor

public org.eclipse.core.runtime.IPath getOldDescriptionLocationFor(IProject target)
The project description file is the only metadata file stored outside the metadata area. It is stored as a file directly under the project location. For backwards compatibility, we also have to check for a project file at the old location in the metadata area.


getOldWorkspaceDescriptionLocation

public org.eclipse.core.runtime.IPath getOldWorkspaceDescriptionLocation()

getPropertyStoreLocation

public org.eclipse.core.runtime.IPath getPropertyStoreLocation(IResource resource)

getSafeTableLocationFor

public org.eclipse.core.runtime.IPath getSafeTableLocationFor(java.lang.String pluginId)

getSnapshotLocationFor

public org.eclipse.core.runtime.IPath getSnapshotLocationFor(IResource resource)

getSyncInfoLocationFor

public org.eclipse.core.runtime.IPath getSyncInfoLocationFor(IResource resource)
Returns the path of the file in which to save the sync information for the given resource. Should only be called for the workspace root and projects.


getSyncInfoSnapshotLocationFor

public org.eclipse.core.runtime.IPath getSyncInfoSnapshotLocationFor(IResource resource)
Returns the path of the file in which to snapshot the sync information for the given resource. Should only be called for the workspace root and projects.


getTreeLocationFor

public org.eclipse.core.runtime.IPath getTreeLocationFor(IResource target,
                                                         boolean updateSequenceNumber)
Returns the local file system location of the tree file for the given resource. This file does not follow the same save number as its plug-in. So, the number here is called "sequence number" and not "save number" to avoid confusion.


getWorkingLocation

public org.eclipse.core.runtime.IPath getWorkingLocation(IResource resource,
                                                         java.lang.String id)

hasSavedProject

public boolean hasSavedProject(IProject project)

hasSavedWorkspace

public boolean hasSavedWorkspace()

locationFor

public org.eclipse.core.runtime.IPath locationFor(org.eclipse.core.runtime.IPath resourcePath)
Returns the local file system location in which the meta data for the resource with the given path is stored.


locationFor

public org.eclipse.core.runtime.IPath locationFor(IResource resource)
Returns the local file system location in which the meta data for the given resource is stored.


readOldDescription

public ProjectDescription readOldDescription(IProject project)
                                      throws org.eclipse.core.runtime.CoreException
Reads and returns the project description for the given project. Returns null if there was no project description file on disk. Throws an exception if there was any failure to read the project.

Throws:
org.eclipse.core.runtime.CoreException

readOldWorkspace

public WorkspaceDescription readOldWorkspace()
Provides backward compatibility with existing workspaces based on descriptions.


readPrivateDescription

public void readPrivateDescription(IProject target,
                                   IProjectDescription description)
Returns the portions of the project description that are private, and adds them to the supplied project description. In particular, the project location and the project's dynamic references are stored here. The project location will be set to null if the default location should be used. In the case of failure, log the exception and return silently, thus reverting to using the default location and no dynamic references. The current format of the location file is: UTF - project location int - number of dynamic project references UTF - project reference 1 ... repeat for remaining references


write

public void write(WorkspaceDescription description)
           throws org.eclipse.core.runtime.CoreException
Deprecated. should not be called any more - workspace preferences are now maintained in the plug-in's preferences

Writes the workspace description to the local meta area. This method is synchronized to prevent multiple current write attempts.

Throws:
org.eclipse.core.runtime.CoreException

writePrivateDescription

public void writePrivateDescription(IProject target)
                             throws org.eclipse.core.runtime.CoreException
Write the private project description information, including the location and the dynamic project references. See readPrivateDescription for details on the file format.

Throws:
org.eclipse.core.runtime.CoreException