Class LocationManager
java.lang.Object
com.e1c.g5.v8.dt.internal.snapshot.integration.git.LocationManager
- All Implemented Interfaces:
ISnapshotLocationProvider
Manages snapshot files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLocationFor
(org.eclipse.core.resources.IProject project, org.eclipse.jgit.lib.ObjectId revision) Determines location for existing or non-existing snapshot for the given project and commit.boolean
hasSnapshotFor
(org.eclipse.core.resources.IProject project, org.eclipse.jgit.lib.ObjectId revision) Checks whether a snapshot for the given project and commit exists.org.eclipse.jgit.lib.ObjectId[]
listAvailableSnapshots
(org.eclipse.core.resources.IProject project) Gets all commits such that a snapshot for the given project and the commit exists.void
removeSnapshotFor
(org.eclipse.core.resources.IProject project, org.eclipse.jgit.lib.ObjectId revison) Removes the snapshot, referred to by the given project and commit.
-
Constructor Details
-
LocationManager
public LocationManager()Constructs the manager.
-
-
Method Details
-
hasSnapshotFor
public boolean hasSnapshotFor(org.eclipse.core.resources.IProject project, org.eclipse.jgit.lib.ObjectId revision) Description copied from interface:ISnapshotLocationProvider
Checks whether a snapshot for the given project and commit exists.- Specified by:
hasSnapshotFor
in interfaceISnapshotLocationProvider
- Parameters:
project
- the project, cannot benull
revision
- SHA-1 of the commit, cannot benull
- Returns:
true
if the snapshot exists
-
getLocationFor
public Path getLocationFor(org.eclipse.core.resources.IProject project, org.eclipse.jgit.lib.ObjectId revision) Description copied from interface:ISnapshotLocationProvider
Determines location for existing or non-existing snapshot for the given project and commit.- Specified by:
getLocationFor
in interfaceISnapshotLocationProvider
- Parameters:
project
- the project, cannot benull
revision
- SHA-1 of the commit, cannot benull
- Returns:
- the snapshot location, never
null
-
listAvailableSnapshots
public org.eclipse.jgit.lib.ObjectId[] listAvailableSnapshots(org.eclipse.core.resources.IProject project) Description copied from interface:ISnapshotLocationProvider
Gets all commits such that a snapshot for the given project and the commit exists.- Specified by:
listAvailableSnapshots
in interfaceISnapshotLocationProvider
- Parameters:
project
- the project, cannot benull
- Returns:
- array of SHA-1 of the commits, never
null
-
removeSnapshotFor
public void removeSnapshotFor(org.eclipse.core.resources.IProject project, org.eclipse.jgit.lib.ObjectId revison) Removes the snapshot, referred to by the given project and commit.- Parameters:
project
- the project, cannot benull
revison
- SHA-1 of the commit, cannot benull
- Throws:
SnapshotIntegrationException
- if the removal failed
-