Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-08-14 19:39:12 +0000
committerMichael Valenta2003-08-14 19:39:12 +0000
commit708a8fc5ff6b2a231825826b69b97637a5ee8643 (patch)
tree399475b77383ed1b85e3409525ab14a3af81eff4
parentb959280f790f2a87455a10b65f693872a0ddf2fd (diff)
downloadeclipse.platform.team-708a8fc5ff6b2a231825826b69b97637a5ee8643.tar.gz
eclipse.platform.team-708a8fc5ff6b2a231825826b69b97637a5ee8643.tar.xz
eclipse.platform.team-708a8fc5ff6b2a231825826b69b97637a5ee8643.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java64
1 files changed, 30 insertions, 34 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
index 4e6dcf3f1..bf10a2259 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
@@ -72,9 +72,6 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
List newRemoteFiles = new ArrayList();
boolean exists = true;
List exceptions = new ArrayList();
- protected List getExceptions() {
- return exceptions;
- }
protected List getNewRemoteDirectories() {
return newRemoteDirectories;
}
@@ -117,11 +114,33 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
}
public void fileDoesNotExist(ICVSFolder parent, String filename) {
}
- public boolean foundChildren() {
- return newRemoteDirectories.size() + newRemoteFiles.size() != 0;
- }
- public boolean parentFolderExists() {
- return exists;
+
+ public void performErrorCheck(IStatus status) throws CVSException {
+ if (status.getCode() == CVSStatus.SERVER_ERROR) {
+ // Only throw the exception if no files or folders were found
+ if (newRemoteDirectories.size() + newRemoteFiles.size() == 0) {
+ throw new CVSServerException(status);
+ } else {
+ CVSProviderPlugin.log(new CVSServerException(status));
+ }
+
+ }
+ if (!exists) {
+ throw new CVSException(new CVSStatus(CVSStatus.ERROR, CVSStatus.DOES_NOT_EXIST, Policy.bind("RemoteFolder.doesNotExist", getRepositoryRelativePath()))); //$NON-NLS-1$
+ }
+
+ // Report any internal exceptions that occured fetching the members
+ if ( ! exceptions.isEmpty()) {
+ if (exceptions.size() == 1) {
+ throw (CVSException)exceptions.get(0);
+ } else {
+ MultiStatus multi = new MultiStatus(CVSProviderPlugin.ID, 0, Policy.bind("RemoteFolder.errorFetchingMembers"), null); //$NON-NLS-1$
+ for (int i = 0; i < exceptions.size(); i++) {
+ multi.merge(((CVSException)exceptions.get(i)).getStatus());
+ }
+ throw new CVSException(multi);
+ }
+ }
}
}
@@ -349,35 +368,12 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
// Perform an update to retrieve the child files and folders
IStatus status = performUpdate(tag, listener, Policy.subMonitorFor(progress, 50));
+ Policy.checkCanceled(monitor);
- if (status.getCode() == CVSStatus.SERVER_ERROR) {
- // Only throw the exception if no files or folders were found
- if (!listener.foundChildren()) {
- throw new CVSServerException(status);
- } else {
- CVSProviderPlugin.log(new CVSServerException(status));
- }
-
- }
- if (! listener.parentFolderExists()) {
- throw new CVSException(new CVSStatus(CVSStatus.ERROR, CVSStatus.DOES_NOT_EXIST, Policy.bind("RemoteFolder.doesNotExist", getRepositoryRelativePath()))); //$NON-NLS-1$
- }
-
- // Report any internal exceptions that occured fetching the members
- if ( ! listener.getExceptions().isEmpty()) {
- if (listener.getExceptions().size() == 1) {
- throw (CVSException)listener.getExceptions().get(0);
- } else {
- MultiStatus multi = new MultiStatus(CVSProviderPlugin.ID, 0, Policy.bind("RemoteFolder.errorFetchingMembers"), null); //$NON-NLS-1$
- for (int i = 0; i < listener.getExceptions().size(); i++) {
- multi.merge(((CVSException)listener.getExceptions().get(i)).getStatus());
- }
- throw new CVSException(multi);
- }
- }
+ // Handle any errors that were identified by the listener
+ listener.performErrorCheck(status);
// Convert the file names to remote resources
- Policy.checkCanceled(monitor);
List result = new ArrayList();
List remoteFiles = new ArrayList();
for (int i=0;i<listener.getNewRemoteFiles().size();i++) {

Back to the top