1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-26 18:35: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,8 +1763,10 @@ 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);
long ts = properties.getRemoteFileTimeStamp();
if (ts != 0){ // don't set 0 timestamp
try { try {
targetFS.setLastModified(newFile, properties.getRemoteFileTimeStamp(), monitor); targetFS.setLastModified(newFile, ts, monitor);
} }
catch (SystemUnsupportedOperationException e){ catch (SystemUnsupportedOperationException e){
// service doesn't support setLastModified // service doesn't support setLastModified
@ -1771,6 +1774,7 @@ public class UniversalFileTransferUtility {
} }
} }
} }
}
catch (RemoteFileIOException e) catch (RemoteFileIOException e)
{ {
@ -2019,6 +2023,7 @@ public class UniversalFileTransferUtility {
if (timestamp == 0) if (timestamp == 0)
timestamp = srcFileOrFolder.getLocalTimeStamp(); timestamp = srcFileOrFolder.getLocalTimeStamp();
if (timestamp != 0){ // don't set 0 timestamps
try { try {
targetFS.setLastModified(copiedFile, timestamp, monitor); targetFS.setLastModified(copiedFile, timestamp, monitor);
} }
@ -2027,6 +2032,7 @@ public class UniversalFileTransferUtility {
SystemBasePlugin.logError("Unable to set last modified", e); //$NON-NLS-1$ SystemBasePlugin.logError("Unable to set last modified", e); //$NON-NLS-1$
} }
} }
}
return copiedFile; return copiedFile;
} }
@ -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