diff options
author | Michael Valenta | 2006-11-15 21:39:26 +0000 |
---|---|---|
committer | Michael Valenta | 2006-11-15 21:39:26 +0000 |
commit | 0f1b0a9650a26b22d4465b2ec6f2038cd1141465 (patch) | |
tree | 79b791042ddf3503e81a2cc7b1678b3dae5d72dd /bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources | |
parent | 811893a66206a7a033738607138d80fcd0bd7eb9 (diff) | |
download | eclipse.platform.team-0f1b0a9650a26b22d4465b2ec6f2038cd1141465.tar.gz eclipse.platform.team-0f1b0a9650a26b22d4465b2ec6f2038cd1141465.tar.xz eclipse.platform.team-0f1b0a9650a26b22d4465b2ec6f2038cd1141465.zip |
Bug 164480 Support a flexible URI scheme for accessing resources in a repository
Diffstat (limited to 'bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources')
-rw-r--r-- | bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java index f3212c7e8..5c413569c 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java @@ -28,6 +28,7 @@ import org.eclipse.team.internal.ccvs.core.client.listeners.ILogEntryListener; import org.eclipse.team.internal.ccvs.core.client.listeners.LogListener; import org.eclipse.team.internal.ccvs.core.connection.CVSServerException; import org.eclipse.team.internal.ccvs.core.filehistory.CVSResourceVariantFileRevision; +import org.eclipse.team.internal.ccvs.core.filesystem.CVSURI; import org.eclipse.team.internal.ccvs.core.syncinfo.*; /** @@ -100,11 +101,19 @@ public class RemoteFile extends RemoteResource implements ICVSRemoteFile { * given location. */ public static RemoteFile create(String filePath, ICVSRepositoryLocation location) { + return create(filePath, location, null, null); + } + + /** + * Create a remote file handle for the given file path that is relative to the + * given location. + */ + public static RemoteFile create(String filePath, ICVSRepositoryLocation location, CVSTag tag, String revision) { Assert.isNotNull(filePath); Assert.isNotNull(location); IPath path = new Path(null, filePath); - RemoteFolder parent = new RemoteFolder(null /* parent */, location, path.removeLastSegments(1).toString(), null /* tag */); - RemoteFile file = new RemoteFile(parent, Update.STATE_NONE, path.lastSegment(), null /* revision */, null /* keyword mode */, null /* tag */); + RemoteFolder parent = new RemoteFolder(null /* parent */, location, path.removeLastSegments(1).toString(), tag /* tag */); + RemoteFile file = new RemoteFile(parent, Update.STATE_NONE, path.lastSegment(), revision /* revision */, null /* keyword mode */, tag /* tag */); parent.setChildren(new ICVSRemoteResource[] {file}); return file; } @@ -316,7 +325,7 @@ public class RemoteFile extends RemoteResource implements ICVSRemoteFile { * Get a different revision of the remote file. * * We must also create a new parent since the child is accessed through the parent from within CVS commands. - * Therefore, we need a new parent so that we can fecth the contents of the remote file revision + * Therefore, we need a new parent so that we can fetch the contents of the remote file revision */ public RemoteFile toRevision(String revision) { RemoteFolder newParent = new RemoteFolder(null, parent.getRepository(), parent.getRepositoryRelativePath(), parent.getTag()); @@ -661,4 +670,9 @@ public class RemoteFile extends RemoteResource implements ICVSRemoteFile { return new CVSResourceVariantFileRevision(this); return super.getAdapter(adapter); } + + public CVSURI toCVSURI() { + ResourceSyncInfo info = getSyncInfo(); + return new CVSURI(getRepository(), new Path(getRepositoryRelativePath()), info.getTag(), info.getRevision()); + } } |