Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-02-28 18:07:19 -0500
committerJean Michel-Lemieux2002-02-28 18:07:19 -0500
commit4c30bc4f0235cad205a4aae49203eac639d0425d (patch)
treeb44b5411b8523ba23b9ecdab6b2aa9e8fb9610b1
parent0e3293fc6a815dfe4d2f6fcc9ebee53b9559ff22 (diff)
downloadeclipse.platform.team-4c30bc4f0235cad205a4aae49203eac639d0425d.tar.gz
eclipse.platform.team-4c30bc4f0235cad205a4aae49203eac639d0425d.tar.xz
eclipse.platform.team-4c30bc4f0235cad205a4aae49203eac639d0425d.zip
refactoring progress..
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java16
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java7
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java34
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java19
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java37
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java14
8 files changed, 75 insertions, 57 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
index 45ab49512..fe6ce870d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
@@ -257,12 +257,16 @@ public abstract class Command {
// of the local root folder.
ICVSResource[] resources = new ICVSResource[arguments.length];
for (int i = 0; i < arguments.length; i++) {
- try {
- resources[i] = localRoot.getChild(arguments[i]);
- } catch (CVSFileNotFoundException e) {
- // XXX Temporary fix to allow non-managed resources to be used as arguments
- resources[i] = localRoot.getFile(arguments[i]);
+ ICVSResource resource = localRoot.getChild(arguments[i]);
+ // file does not exist, it could have been deleted. It doesn't matter
+ // which type we return since only the name of the resource is used
+ // and sent to the server.
+ if(resource==null) {
+ // XXX returning a folder because it is the safest choice when
+ // localRoot is a handle to the IWorkspaceRoot!
+ resource = localRoot.getFolder(arguments[i]);
}
+ resources[i] = resource;
}
return resources;
}
@@ -294,7 +298,7 @@ public abstract class Command {
/// XXX should perhaps use a visitor instead of type checking
if (resources[i].isFolder()) folder = (ICVSFolder) resources[i];
else folder = resources[i].getParent();
- if (! folder.isCVSFolder()) {
+ if (folder==null || !folder.isCVSFolder()) {
throw new CVSException(Policy.bind("Command.argumentNotManaged", folder.getName()));//$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
index baae9c0fa..7e2d7fb8a 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
@@ -160,7 +160,8 @@ public class CVSRemoteSyncElement extends RemoteSyncElement {
if (local.exists()) {
// We could have an incoming change or deletion
if (remote == null) {
- info = new ResourceSyncInfo(local.getName(), ResourceSyncInfo.ADDED_REVISION, ResourceSyncInfo.DUMMY_TIMESTAMP, CVSProvider.isText(local.getName())?ResourceSyncInfo.USE_SERVER_MODE:ResourceSyncInfo.BINARY_TAG, local.getParent().getFolderSyncInfo().getTag(), null);
+ info = new ResourceSyncInfo(local.getName(), ResourceSyncInfo.ADDED_REVISION, ResourceSyncInfo.DUMMY_TIMESTAMP,
+ CVSProvider.isText(local.getName()) ? ResourceSyncInfo.USE_SERVER_MODE:ResourceSyncInfo.BINARY_TAG, local.getParent().getFolderSyncInfo().getTag(), null);
revision = info.getRevision();
} else {
info = remote.getSyncInfo();
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
index b2957c444..7a2c24202 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
@@ -55,7 +55,12 @@ class EclipseFile extends EclipseResource implements ICVSFile {
return new ByteArrayOutputStream() {
public void close() throws IOException {
try {
- getIFile().setContents(new ByteArrayInputStream(toByteArray()), true /*force*/, true /*keep history*/, null);
+ IFile file = getIFile();
+ if(resource.exists()) {
+ file.setContents(new ByteArrayInputStream(toByteArray()), true /*force*/, true /*keep history*/, null);
+ } else {
+ file.create(new ByteArrayInputStream(toByteArray()), true /*force*/, null);
+ }
super.close();
} catch(CoreException e) {
throw new IOException("Error setting file contents: " + e.getMessage());
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
index 8e4a55bda..0f9b2481b 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
@@ -13,7 +13,9 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.team.ccvs.core.*;
@@ -113,7 +115,12 @@ class EclipseFolder extends EclipseResource implements ICVSFolder {
public ICVSFolder getFolder(String name) throws CVSException {
if ((CURRENT_LOCAL_FOLDER.equals(name)) || ((CURRENT_LOCAL_FOLDER + SEPARATOR).equals(name)))
return this;
- return new EclipseFolder(((IContainer)resource).getFolder(new Path(name)));
+ IPath path = new Path(name);
+ if(resource.getType()==IResource.ROOT && path.segmentCount()==1) {
+ return new EclipseFolder(((IWorkspaceRoot)resource).getProject(name));
+ } else {
+ return new EclipseFolder(((IContainer)resource).getFolder(new Path(name)));
+ }
}
/**
@@ -129,7 +136,9 @@ class EclipseFolder extends EclipseResource implements ICVSFolder {
public void mkdir() throws CVSException {
try {
if(resource.getType()==IResource.PROJECT) {
- ((IProject)resource).create(null);
+ IProject project = (IProject)resource;
+ project.create(null);
+ project.open(null);
} else {
((IFolder)resource).create(false /*don't force*/, true /*make local*/, null);
}
@@ -176,23 +185,20 @@ class EclipseFolder extends EclipseResource implements ICVSFolder {
* @see ICVSResource#getRemoteLocation(ICVSFolder)
*/
public String getRemoteLocation(ICVSFolder stopSearching) throws CVSException {
-
- String parentLocation;
-
+
if (getFolderSyncInfo() != null) {
return getFolderSyncInfo().getRemoteLocation();
}
- if (equals(stopSearching)) {
- return null;
+ ICVSFolder parent = getParent();
+ if(parent!=null && !equals(stopSearching)) {
+ String parentLocation;
+ parentLocation = parent.getRemoteLocation(stopSearching);
+ if (parentLocation!=null) {
+ return parentLocation + SEPARATOR + getName();
+ }
}
-
- parentLocation = getParent().getRemoteLocation(stopSearching);
- if (parentLocation == null) {
- return null;
- } else {
- return parentLocation + SEPARATOR + getName();
- }
+ return null;
}
/*
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
index 4ed893b12..377bd625f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
@@ -10,6 +10,7 @@ import java.io.File;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.ICVSFolder;
@@ -95,7 +96,7 @@ abstract class EclipseResource implements ICVSResource {
*/
public ICVSFolder getParent() {
IContainer parent = resource.getParent();
- if (parent == null || parent.getType() == IResource.ROOT) {
+ if (parent==null) {
return null;
}
return new EclipseFolder(parent);
@@ -232,20 +233,30 @@ abstract class EclipseResource implements ICVSResource {
* eclipse resource. Must be removed when the refactoring is complete.
*/
protected File getIOFile() {
- return resource.getLocation().toFile();
+ IPath location = resource.getLocation();
+ if(location!=null) {
+ return location.toFile();
+ }
+ return null;
}
/*
* @see ICVSResource#reloadSyncInfo(IProgressMonitor)
*/
public void reloadSyncInfo(IProgressMonitor monitor) throws CVSException {
- CVSProviderPlugin.getSynchronizer().reload(getIOFile(), monitor);
+ File file = getIOFile();
+ if(file!=null) {
+ CVSProviderPlugin.getSynchronizer().reload(file, monitor);
+ }
}
/*
* @see ICVSResource#saveSyncInfo(IProgressMonitor)
*/
public void saveSyncInfo(IProgressMonitor monitor) throws CVSException {
- CVSProviderPlugin.getSynchronizer().save(getIOFile(), monitor);
+ File file = getIOFile();
+ if(file!=null) {
+ CVSProviderPlugin.getSynchronizer().save(file, monitor);
+ }
}
} \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
index df12f4293..a0b4e65e3 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
@@ -27,12 +27,13 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.harness.EclipseWorkspaceTest;
-import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSStatus;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.ccvs.core.ICVSFile;
import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSRemoteFile;
import org.eclipse.team.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.TeamException;
@@ -47,9 +48,6 @@ import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.connection.CVSServerException;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
-import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
@@ -151,7 +149,7 @@ public class EclipseTest extends EclipseWorkspaceTest {
public void unmanageResources(IContainer container, String[] hierarchy) throws CoreException, TeamException {
IResource[] resources = getResources(container, hierarchy);
for (int i=0;i<resources.length;i++) {
- Session.getManagedResource(resources[i]).unmanage();
+ CVSWorkspaceRoot.getCVSResourceFor(resources[i]).unmanage();
}
CVSProviderPlugin.getSynchronizer().save(container.getLocation().toFile(), DEFAULT_MONITOR);
}
@@ -222,7 +220,7 @@ public class EclipseTest extends EclipseWorkspaceTest {
// Check the project out under a different name and validate that the results are the same
IProject copy = getWorkspace().getRoot().getProject(project.getName() + postfix);
- CVSProviderPlugin.getProvider().checkout(getRepository(), copy, ((ICVSFolder)Session.getManagedResource(project)).getFolderSyncInfo().getRepository(), null, DEFAULT_MONITOR);
+ CVSProviderPlugin.getProvider().checkout(getRepository(), copy, CVSWorkspaceRoot.getCVSFolderFor(project).getFolderSyncInfo().getRepository(), null, DEFAULT_MONITOR);
return copy;
}
@@ -232,7 +230,9 @@ public class EclipseTest extends EclipseWorkspaceTest {
// Check the project out under a different name and validate that the results are the same
IProject copy = getWorkspace().getRoot().getProject(project.getName() + tag.getName());
- CVSProviderPlugin.getProvider().checkout(getRepository(), copy, ((ICVSFolder)Session.getManagedResource(project)).getFolderSyncInfo().getRepository(), tag, DEFAULT_MONITOR);
+ CVSProviderPlugin.getProvider().checkout(getRepository(), copy,
+ CVSWorkspaceRoot.getCVSFolderFor(project).getFolderSyncInfo().getRepository(),
+ tag, DEFAULT_MONITOR);
return copy;
}
@@ -273,7 +273,9 @@ public class EclipseTest extends EclipseWorkspaceTest {
* Compare CVS team providers by comparing the cvs resource corresponding to the provider's project
*/
protected void assertEquals(CVSTeamProvider provider1, CVSTeamProvider provider2, boolean includeTimestamps, boolean includeTags) throws CoreException, TeamException, IOException {
- assertEquals(Path.EMPTY, (ICVSFolder)Session.getManagedFolder(provider1.getProject().getLocation().toFile()), (ICVSFolder)Session.getManagedFolder(provider2.getProject().getLocation().toFile()), includeTimestamps, includeTags);
+ assertEquals(Path.EMPTY, CVSWorkspaceRoot.getCVSFolderFor(provider1.getProject()),
+ CVSWorkspaceRoot.getCVSFolderFor(provider2.getProject()),
+ includeTimestamps, includeTags);
}
/*
@@ -434,26 +436,17 @@ public class EclipseTest extends EclipseWorkspaceTest {
assertNotNull(provider);
}
protected InputStream getContents(ICVSFile file) throws CVSException, IOException {
- if (file instanceof LocalFile)
- return new BufferedInputStream(new FileInputStream(getFile(file)));
- else
+ if (file instanceof ICVSRemoteFile)
return ((RemoteFile)file).getContents(DEFAULT_MONITOR);
+ else
+ return new BufferedInputStream(file.getInputStream());
}
/*
* Get the CVS Resource for the given resource
*/
protected ICVSResource getCVSResource(IResource resource) throws CVSException {
- if (resource.getType() == IResource.FILE)
- return Session.getManagedFile(resource.getLocation().toFile());
- else
- return Session.getManagedFolder(resource.getLocation().toFile());
- }
- /*
- * Get the IO File for the given CVS resource
- */
- protected File getFile(ICVSResource mResource) {
- return new File(((LocalResource)mResource).getPath());
+ return CVSWorkspaceRoot.getCVSResourceFor(resource);
}
protected IProject getNamedTestProject(String name) throws CoreException {
@@ -516,7 +509,7 @@ public class EclipseTest extends EclipseWorkspaceTest {
protected void importProject(IProject project) throws TeamException {
// Create the root folder for the import operation
- ICVSFolder root = (ICVSFolder)Session.getManagedResource(project);
+ ICVSFolder root = CVSWorkspaceRoot.getCVSFolderFor(project);
// Perform the import
IStatus status;
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
index 540547037..13c6b808e 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
@@ -21,7 +21,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSStatus;
import org.eclipse.team.ccvs.core.ICVSFolder;
@@ -35,7 +34,6 @@ import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.connection.CVSServerException;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
-import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
import org.eclipse.team.internal.ccvs.core.util.FileUtil;
import org.eclipse.team.internal.ccvs.core.util.Util;
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
index dfaa793e2..d5d623151 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
@@ -54,7 +54,7 @@ public class RemoteResourceTest extends EclipseTest {
}
protected void assertRemoteMatchesLocal(String message, RemoteFolder remote, IContainer container) throws CVSException, IOException, CoreException {
- assertEquals(Path.EMPTY, (ICVSResource)remote, CVSWorkspaceRoot.getCVSFolderFor(container.getLocation().toFile()), false, false);
+ assertEquals(Path.EMPTY, (ICVSResource)remote, CVSWorkspaceRoot.getCVSFolderFor(container), false, false);
}
protected void getMembers(ICVSRemoteFolder folder, boolean deep) throws TeamException {
@@ -111,7 +111,7 @@ public class RemoteResourceTest extends EclipseTest {
*/
public void testGetBase() throws TeamException, CoreException, IOException {
IProject project = createProject("testGetBase", new String[] { "file1.txt", "file2.txt", "folder1/a.txt", "folder2/folder3/b.txt"});
- RemoteFolderTree tree = RemoteFolderTreeBuilder.buildBaseTree(getRepository(), CVSWorkspaceRoot.getCVSFolderFor(project.getLocation().toFile()), CVSTag.DEFAULT, DEFAULT_MONITOR);
+ RemoteFolderTree tree = RemoteFolderTreeBuilder.buildBaseTree(getRepository(), CVSWorkspaceRoot.getCVSFolderFor(project), CVSTag.DEFAULT, DEFAULT_MONITOR);
assertRemoteMatchesLocal("testGetBase", tree, project);
}
@@ -167,10 +167,10 @@ public class RemoteResourceTest extends EclipseTest {
*/
public void testGetRemoteResource() throws CoreException, TeamException, IOException {
IProject project = createProject("testGetRemoteResource", new String[] { "file1.txt", "folder1/", "folder1/a.txt", "folder2/", "folder2/a.txt", "folder2/folder3/", "folder2/folder3/b.txt", "folder2/folder3/c.txt"});
- ICVSRemoteResource file = getProvider(project).getRemoteResource(project.getFile("folder1/a.txt"));
+ ICVSRemoteResource file = CVSWorkspaceRoot.getRemoteResourceFor(project.getFile("folder1/a.txt"));
assertTrue("File should exist remotely", file.exists());
- assertEquals(Path.EMPTY, (ICVSResource)file, (ICVSResource)CVSWorkspaceRoot.getRemoteFileFor(project.getFile("folder1/a.txt").getLocation().toFile()), false, false);
- ICVSRemoteResource folder = getProvider(project).getRemoteResource(project.getFolder("folder2/folder3/"));
+ assertEquals(Path.EMPTY, (ICVSResource)file, (ICVSResource)CVSWorkspaceRoot.getRemoteResourceFor(project.getFile("folder1/a.txt")), false, false);
+ ICVSRemoteResource folder = CVSWorkspaceRoot.getRemoteResourceFor(project.getFolder("folder2/folder3/"));
getMembers((ICVSRemoteFolder)folder, true);
assertTrue("Folder should exist remotely", folder.exists());
// XXX this didn't work right. I'll need to check into it later
@@ -215,7 +215,7 @@ public class RemoteResourceTest extends EclipseTest {
file.setContents(new ByteArrayInputStream(new byte[0]), false, false, DEFAULT_MONITOR);
commitResources(project, new String[] {"file.txt"});
- ICVSRemoteResource remote = getProvider(project).getRemoteResource(file);
+ ICVSRemoteResource remote = CVSWorkspaceRoot.getRemoteResourceFor(file);
InputStream in = remote.getContents(DEFAULT_MONITOR);
int count = 0;
while(in.read() != -1) {
@@ -239,7 +239,7 @@ public class RemoteResourceTest extends EclipseTest {
file.setContents(new ByteArrayInputStream("bye there".getBytes()), false, false, DEFAULT_MONITOR);
commitResources(project, new String[] {"file.txt"});
- ICVSRemoteFile remote = (ICVSRemoteFile)getProvider(project).getRemoteResource(file);
+ ICVSRemoteFile remote = (ICVSRemoteFile)CVSWorkspaceRoot.getRemoteResourceFor(file);
ILogEntry[] entries = remote.getLogEntries(DEFAULT_MONITOR);
for (int i=0;i<entries.length;i++) {
InputStream in = entries[i].getRemoteFile().getContents(DEFAULT_MONITOR);

Back to the top