Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java')
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java7
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);
}
}

Back to the top