1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 07:05:24 +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) - [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) - [386486] when the original timestamp of a file is 0 don't set it after an upload
*******************************************************************************/
package org.eclipse.rse.files.ui.resources;
@ -1762,12 +1763,15 @@ public class UniversalFileTransferUtility {
if (RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.PRESERVETIMESTAMPS))
{
SystemIFileProperties properties = new SystemIFileProperties(srcFileOrFolder);
try {
targetFS.setLastModified(newFile, properties.getRemoteFileTimeStamp(), monitor);
}
catch (SystemUnsupportedOperationException e){
// service doesn't support setLastModified
SystemBasePlugin.logError("Unable to set last modified", e); //$NON-NLS-1$
long ts = properties.getRemoteFileTimeStamp();
if (ts != 0){ // don't set 0 timestamp
try {
targetFS.setLastModified(newFile, ts, monitor);
}
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)
timestamp = srcFileOrFolder.getLocalTimeStamp();
try {
targetFS.setLastModified(copiedFile, timestamp, monitor);
}
catch (SystemUnsupportedOperationException e){
// service doesn't support setLastModified
SystemBasePlugin.logError("Unable to set last modified", e); //$NON-NLS-1$
if (timestamp != 0){ // don't set 0 timestamps
try {
targetFS.setLastModified(copiedFile, timestamp, monitor);
}
catch (SystemUnsupportedOperationException e){
// 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);
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){
// service doesn't support setLastModified