### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.services.files.ftp Index: src/org/eclipse/rse/internal/services/files/ftp/FTPServiceResources.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPServiceResources.java,v retrieving revision 1.3 diff -u -r1.3 FTPServiceResources.java --- src/org/eclipse/rse/internal/services/files/ftp/FTPServiceResources.java 25 Jul 2007 17:44:51 -0000 1.3 +++ src/org/eclipse/rse/internal/services/files/ftp/FTPServiceResources.java 30 Jul 2007 15:43:33 -0000 @@ -29,7 +29,6 @@ public static String FTP_File_Service_Monitor_Format; public static String FTP_File_Service_Name; public static String FTP_File_Service_Description; - public static String FTPService_FTP_File_Service_Not_Found; static { // load message values from bundle file Index: src/org/eclipse/rse/internal/services/files/ftp/FTPService.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPService.java,v retrieving revision 1.26 diff -u -r1.26 FTPService.java --- src/org/eclipse/rse/internal/services/files/ftp/FTPService.java 25 Jul 2007 17:44:51 -0000 1.26 +++ src/org/eclipse/rse/internal/services/files/ftp/FTPService.java 30 Jul 2007 15:43:33 -0000 @@ -57,6 +57,7 @@ import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -674,22 +688,12 @@ if (monitor!=null){ if (monitor.isCanceled()) { - return false; + throw new RemoteFileCancelledException(); } } IHostFile remoteHostFile = getFile(remoteParent,remoteFile,null); - if(remoteHostFile == null) - { - return false; - } - - if(!remoteHostFile.exists()) - { - throw new RemoteFileIOException(new Exception(FTPServiceResources.FTPService_FTP_File_Service_Not_Found)); - } - if(_commandMutex.waitForLock(monitor, Long.MAX_VALUE)) { try @@ -703,21 +707,22 @@ ftpClient.changeWorkingDirectory(remoteParent); setFileType(isBinary); - if (!localFile.exists()) - { - File localParentFile = localFile.getParentFile(); - if (!localParentFile.exists()) - { - localParentFile.mkdirs(); - } - localFile.createNewFile(); - } - output = new FileOutputStream(localFile); input = ftpClient.retrieveFileStream(remoteFile); if(input != null) { + if (!localFile.exists()) + { + File localParentFile = localFile.getParentFile(); + if (!localParentFile.exists()) + { + localParentFile.mkdirs(); + } + localFile.createNewFile(); + } + + output = new FileOutputStream(localFile); progressMonitor.init(0, remoteFile, localFile.getName(), remoteHostFile.getSize()); byte[] buffer = new byte[4096]; int readCount; @@ -740,12 +745,22 @@ output.close(); ftpClient.completePendingCommand(); + + } + else + { + throw new RemoteFileIOException(new Exception(ftpClient.getReplyString())); } } - catch (Exception e) + catch (FileNotFoundException e) + { + throw new RemoteFileIOException(e); + } + catch (IOException e) { throw new RemoteFileIOException(e); - } finally + } + finally { _commandMutex.release(); } Index: src/org/eclipse/rse/internal/services/files/ftp/FTPServiceResources.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPServiceResources.properties,v retrieving revision 1.3 diff -u -r1.3 FTPServiceResources.properties --- src/org/eclipse/rse/internal/services/files/ftp/FTPServiceResources.properties 25 Jul 2007 17:44:51 -0000 1.3 +++ src/org/eclipse/rse/internal/services/files/ftp/FTPServiceResources.properties 30 Jul 2007 15:43:33 -0000 @@ -24,5 +24,4 @@ FTP_File_Service_Copy_Not_Supported=FTP copy not supported, use move instead FTP_File_Service_Listing_Job=Listing files... FTP_File_Service_Listing_Job_Success=Success -FTPService_FTP_File_Service_Not_Found=File not found FTP_File_Service_Monitor_Format={0,number,integer} KB of {1,number,integer} KB complete ({2,number,percent})