1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-02 21:23:37 +02:00

Bug 149150 - fix modtime for local subsystem, FTP and dstore to check

This commit is contained in:
Martin Oberhuber 2006-06-29 21:43:25 +00:00
parent 1ed80584e7
commit 992747ac6a

View file

@ -380,6 +380,15 @@ public class LocalFileService extends AbstractFileService implements IFileServic
{ {
// throw new RemoteFileCancelledException(); // throw new RemoteFileCancelledException();
return false; return false;
} else if (destinationFile!=null && file.exists()) {
destinationFile.setLastModified(file.lastModified());
//TODO check if we want to preserve permissions
//if(!file.canWrite()) destinationFile.setReadOnly();
if (destinationFile.length() != file.length()) {
// throw new RemoteFileCancelledException();
System.err.println("local.upload: size mismach on "+destinationFile.getAbsolutePath());
return false;
}
} }
} }
catch (IOException e) catch (IOException e)
@ -448,6 +457,7 @@ public class LocalFileService extends AbstractFileService implements IFileServic
BufferedOutputStream bufOutputStream = null; BufferedOutputStream bufOutputStream = null;
OutputStreamWriter outputWriter = null; OutputStreamWriter outputWriter = null;
BufferedWriter bufWriter = null; BufferedWriter bufWriter = null;
File destinationFile = null;
File target = new File(remoteParent, remoteFile); File target = new File(remoteParent, remoteFile);
boolean sourceIsVirtual = ArchiveHandlerManager.isVirtual(localFile.getAbsolutePath()); boolean sourceIsVirtual = ArchiveHandlerManager.isVirtual(localFile.getAbsolutePath());
@ -463,7 +473,7 @@ public class LocalFileService extends AbstractFileService implements IFileServic
try try
{ {
File destinationFile = new File(remoteParent, remoteFile); destinationFile = new File(remoteParent, remoteFile);
int totalSize = (int) localFile.length(); int totalSize = (int) localFile.length();
File destinationParent = destinationFile.getParentFile(); File destinationParent = destinationFile.getParentFile();
@ -545,6 +555,15 @@ public class LocalFileService extends AbstractFileService implements IFileServic
{ {
// throw new RemoteFileCancelledException(); // throw new RemoteFileCancelledException();
return false; return false;
} else if (destinationFile!=null) {
destinationFile.setLastModified(localFile.lastModified());
//TODO check if we want to preserve permissions
//if(!localFile.canWrite()) destinationFile.setReadOnly();
if (destinationFile.length() != localFile.length()) {
// throw new RemoteFileCancelledException();
System.err.println("local.upload: size mismach on "+destinationFile.getAbsolutePath());
return false;
}
} }
} }
catch (IOException e) catch (IOException e)