From e2e52043545cc68c153ca7da58cdae8393c259d3 Mon Sep 17 00:00:00 2001 From: Kevin Doyle Date: Fri, 30 May 2008 14:28:58 +0000 Subject: [PATCH] [227391] Saving file in Eclipse does not update remote file --- .../ui/resources/UniversalFileTransferUtility.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java index ce1612d436d..1a3b1050161 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java @@ -46,6 +46,7 @@ * Xuan Chen (IBM) - [229093] set charset of the temp file of the text remote file to its remote encoding * Rupen Mardirossian (IBM) - [198728] downloadResourcesToWorkspace now creates empty folders for copying across connections via createEmptyFolders method * David McKnight (IBM) - [229610] [api] File transfers should use workspace text file encoding + * Kevin Doyle (IBM) - [227391] Saving file in Eclipse does not update remote file ********************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -1824,8 +1825,15 @@ public class UniversalFileTransferUtility if (RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.PRESERVETIMESTAMPS)) { - SystemIFileProperties properties = new SystemIFileProperties(srcFileOrFolder); - targetFS.setLastModified(copiedFile, properties.getRemoteFileTimeStamp(), monitor); + SystemIFileProperties properties = new SystemIFileProperties(srcFileOrFolder); + long timestamp = properties.getRemoteFileTimeStamp(); + + // srcFileOrFolder may not be a file from the RemoteSystemTempFiles folder in which + // case there will be no stored property for the remote timestamp. + if (timestamp == 0) + timestamp = srcFileOrFolder.getLocalTimeStamp(); + + targetFS.setLastModified(copiedFile, timestamp, monitor); } return copiedFile;