|
@@ -128,6 +128,7 @@ public class FTP |
|
|
private boolean skipFailedTransfers = false; |
|
|
private boolean skipFailedTransfers = false; |
|
|
private int skipped = 0; |
|
|
private int skipped = 0; |
|
|
private boolean ignoreNoncriticalErrors = false; |
|
|
private boolean ignoreNoncriticalErrors = false; |
|
|
|
|
|
private boolean preserveLastModified = false; |
|
|
private String chmod = null; |
|
|
private String chmod = null; |
|
|
private String umask = null; |
|
|
private String umask = null; |
|
|
private FileUtils fileUtils = FileUtils.newFileUtils(); |
|
|
private FileUtils fileUtils = FileUtils.newFileUtils(); |
|
@@ -330,6 +331,14 @@ public class FTP |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Set to true to preserve modification times for "gotten" files. |
|
|
|
|
|
*/ |
|
|
|
|
|
public void setPreserveLastModified(boolean preserveLastModified) { |
|
|
|
|
|
this.preserveLastModified = preserveLastModified; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Set to true to transmit only files that are new or changed from their |
|
|
* Set to true to transmit only files that are new or changed from their |
|
|
* remote counterparts. The default is to transmit all files. |
|
|
* remote counterparts. The default is to transmit all files. |
|
@@ -822,6 +831,16 @@ public class FTP |
|
|
log("File " + file.getAbsolutePath() + " copied from " |
|
|
log("File " + file.getAbsolutePath() + " copied from " |
|
|
+ server, Project.MSG_VERBOSE); |
|
|
+ server, Project.MSG_VERBOSE); |
|
|
transferred++; |
|
|
transferred++; |
|
|
|
|
|
if (preserveLastModified) { |
|
|
|
|
|
outstream.close(); |
|
|
|
|
|
outstream = null; |
|
|
|
|
|
FTPFile[] remote = ftp.listFiles(resolveFile(filename)); |
|
|
|
|
|
if (remote.length > 0) { |
|
|
|
|
|
fileUtils.setFileLastModified(file, |
|
|
|
|
|
remote[0].getTimestamp() |
|
|
|
|
|
.getTime().getTime()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} finally { |
|
|
} finally { |
|
|
if (outstream != null) { |
|
|
if (outstream != null) { |
|
|