diff options
author | Michael Valenta | 2004-05-11 18:37:37 +0000 |
---|---|---|
committer | Michael Valenta | 2004-05-11 18:37:37 +0000 |
commit | aa8a405f5a600be46150f854f54bddf7715b8901 (patch) | |
tree | eedabd232fa28253f5165d651d22f60e7e79bd22 | |
parent | e6931f8e79254dbe238cca39f165516f5b5ee2d5 (diff) | |
download | eclipse.platform.team-aa8a405f5a600be46150f854f54bddf7715b8901.tar.gz eclipse.platform.team-aa8a405f5a600be46150f854f54bddf7715b8901.tar.xz eclipse.platform.team-aa8a405f5a600be46150f854f54bddf7715b8901.zip |
Bug 61666: Folder sync access during delete
-rw-r--r-- | bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java index f82112343..ebbd0ed52 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java @@ -430,7 +430,7 @@ public class SyncFileWriter { private static String readFirstLine(IFile file) throws CVSException { if (! file.exists()) return null; try { - BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents())); + BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents(true))); try { String line = reader.readLine(); if (line == null) return ""; //$NON-NLS-1$ @@ -441,6 +441,11 @@ public class SyncFileWriter { } catch (IOException e) { throw CVSException.wrapException(e); } catch (CoreException e) { + // If the IFile doesn't exist or the underlying File doesn't exist, + // just return null to indicate the absence of the file + if (e.getStatus().getCode() == IResourceStatus.RESOURCE_NOT_FOUND + || e.getStatus().getCode() == IResourceStatus.FAILED_READ_LOCAL) + return null; throw CVSException.wrapException(e); } } |