From fdae0fb85b17d2d70137f16d3bb6cf5b11105fef Mon Sep 17 00:00:00 2001 From: David McKnight Date: Wed, 14 Jun 2006 15:52:00 +0000 Subject: [PATCH] efs stuff --- .../RSEFileStoreRemoteFileWrapper.java | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileStoreRemoteFileWrapper.java b/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileStoreRemoteFileWrapper.java index e85b7ba3d5e..3d890bf7aa4 100644 --- a/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileStoreRemoteFileWrapper.java +++ b/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileStoreRemoteFileWrapper.java @@ -19,6 +19,7 @@ package org.eclipse.rse.eclipse.filesystem; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; +import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; @@ -170,7 +171,7 @@ public class RSEFileStoreRemoteFileWrapper extends FileStore implements IFileSto } } - public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException + public synchronized InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException { if (_remoteFile.exists()) { @@ -216,7 +217,16 @@ public class RSEFileStoreRemoteFileWrapper extends FileStore implements IFileSto file = (IFile)UniversalFileTransferUtility.copyRemoteResourceToWorkspace(_remoteFile, monitor); if (file != null && !file.isSynchronized(IResource.DEPTH_ZERO)) { - //file.getProject().refreshLocal(IResource.DEPTH_INFINITE, monitor); + /* + try + { + file.refreshLocal(IFile.DEPTH_ZERO, monitor); + } + catch (Exception e) + { + e.printStackTrace(); + } + */ } } } @@ -224,11 +234,29 @@ public class RSEFileStoreRemoteFileWrapper extends FileStore implements IFileSto { file = (IFile)UniversalFileTransferUtility.getTempFileFor(_remoteFile); } -// if (!file.isSynchronized(IFile.DEPTH_ZERO)) - // file.refreshLocal(IFile.DEPTH_ZERO, monitor); + if (!file.isSynchronized(IFile.DEPTH_ZERO) && !_remoteFile.getName().equals(".project")) + { + file.refreshLocal(IFile.DEPTH_ONE, monitor); + } if (file != null) { - return file.getContents(); + if (file.isSynchronized(IFile.DEPTH_ZERO)) + { + return file.getContents(); + } + else + { + File osFile = file.getLocation().toFile(); + try + { + FileInputStream instream = new FileInputStream(osFile); + return instream; + } + catch (Exception e) + { + + } + } } } return null;