### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.files.ui Index: src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java,v retrieving revision 1.18 diff -u -r1.18 SystemUploadConflictAction.java --- src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java 2 Jul 2008 15:01:49 -0000 1.18 +++ src/org/eclipse/rse/internal/files/ui/actions/SystemUploadConflictAction.java 7 Nov 2008 21:38:38 -0000 @@ -21,6 +21,7 @@ * David McKnight (IBM) - [224377] "open with" menu does not have "other" option * Xuan Chen (IBM) - [225506] [api][breaking] RSE UI leaks non-API types * David McKnight (IBM) - [235221] Files truncated on exit of Eclipse + * David McKnight (IBM) - [250140] Backport [usability] Save conflict dialog appears when saving files in the editor *******************************************************************************/ package org.eclipse.rse.internal.files.ui.actions; @@ -105,7 +106,7 @@ if (!_saveasFile.exists()) { _saveasFile = fs.createFile(_saveasFile, monitor); - } + } } catch (SystemMessageException e) { @@ -121,7 +122,7 @@ try { - // copy temp file to remote system + // copy temp file to remote system fs.upload(_tempFile.getLocation().makeAbsolute().toOSString(), _saveasFile, SystemEncodingUtil.ENCODING_UTF_8, monitor); // set original time stamp to 0 so that file will be overwritten next download @@ -197,16 +198,15 @@ { IRemoteFileSubSystem fs = _remoteFile.getParentRemoteFileSubSystem(); SystemIFileProperties properties = new SystemIFileProperties(_tempFile); - fs.upload(_tempFile.getLocation().makeAbsolute().toOSString(), _remoteFile, SystemEncodingUtil.ENCODING_UTF_8, monitor); - // wait for timestamp to update before re-fetching remote file - try { - Thread.sleep(1000); - } - catch (Exception e){ - - } + + // making sure we have the same version as is in the cache + _remoteFile = fs.getRemoteFileObject(_remoteFile.getAbsolutePath(), monitor); + + fs.upload(_tempFile.getLocation().makeAbsolute().toOSString(), _remoteFile, SystemEncodingUtil.ENCODING_UTF_8, monitor); + _remoteFile.markStale(true); _remoteFile = fs.getRemoteFileObject(_remoteFile.getAbsolutePath(), new NullProgressMonitor()); + long ts = _remoteFile.getLastModified(); properties.setRemoteFileTimeStamp(ts); properties.setDirty(false);