1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-26 10:25:32 +02:00

[386486] when the original timestamp of a file is 0 don't set it after an upload

This commit is contained in:
David McKnight 2012-08-03 14:37:24 +00:00
parent 5d0ce36db8
commit c672c4e328

View file

@ -63,6 +63,7 @@
* David McKnight (IBM) - [311218] Content conflict dialog pops up when it should not * David McKnight (IBM) - [311218] Content conflict dialog pops up when it should not
* David McKnight (IBM) - [228743] [usability][dnd] Paste into read-only folder fails silently * David McKnight (IBM) - [228743] [usability][dnd] Paste into read-only folder fails silently
* David McKnight (IBM) - [376410] cross-system copy/paste operation doesn't transfer remote encodings for binary files * David McKnight (IBM) - [376410] cross-system copy/paste operation doesn't transfer remote encodings for binary files
* David McKnight (IBM) - [386486] when the original timestamp of a file is 0 don't set it after an upload
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.files.ui.resources; package org.eclipse.rse.files.ui.resources;
@ -1762,12 +1763,15 @@ public class UniversalFileTransferUtility {
if (RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.PRESERVETIMESTAMPS)) if (RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.PRESERVETIMESTAMPS))
{ {
SystemIFileProperties properties = new SystemIFileProperties(srcFileOrFolder); SystemIFileProperties properties = new SystemIFileProperties(srcFileOrFolder);
try { long ts = properties.getRemoteFileTimeStamp();
targetFS.setLastModified(newFile, properties.getRemoteFileTimeStamp(), monitor); if (ts != 0){ // don't set 0 timestamp
} try {
catch (SystemUnsupportedOperationException e){ targetFS.setLastModified(newFile, ts, monitor);
// service doesn't support setLastModified }
SystemBasePlugin.logError("Unable to set last modified", e); //$NON-NLS-1$ catch (SystemUnsupportedOperationException e){
// service doesn't support setLastModified
SystemBasePlugin.logError("Unable to set last modified", e); //$NON-NLS-1$
}
} }
} }
} }
@ -2019,12 +2023,14 @@ public class UniversalFileTransferUtility {
if (timestamp == 0) if (timestamp == 0)
timestamp = srcFileOrFolder.getLocalTimeStamp(); timestamp = srcFileOrFolder.getLocalTimeStamp();
try { if (timestamp != 0){ // don't set 0 timestamps
targetFS.setLastModified(copiedFile, timestamp, monitor); try {
} targetFS.setLastModified(copiedFile, timestamp, monitor);
catch (SystemUnsupportedOperationException e){ }
// service doesn't support setLastModified catch (SystemUnsupportedOperationException e){
SystemBasePlugin.logError("Unable to set last modified", e); //$NON-NLS-1$ // service doesn't support setLastModified
SystemBasePlugin.logError("Unable to set last modified", e); //$NON-NLS-1$
}
} }
} }
@ -2262,7 +2268,10 @@ public class UniversalFileTransferUtility {
{ {
SystemIFileProperties properties = new SystemIFileProperties(source); SystemIFileProperties properties = new SystemIFileProperties(source);
try { try {
target.getParentRemoteFileSubSystem().setLastModified(target, properties.getRemoteFileTimeStamp(), monitor); long ts = properties.getRemoteFileTimeStamp();
if (ts != 0){ // don't set 0 timestamps
target.getParentRemoteFileSubSystem().setLastModified(target, ts, monitor);
}
} }
catch (SystemUnsupportedOperationException e){ catch (SystemUnsupportedOperationException e){
// service doesn't support setLastModified // service doesn't support setLastModified