private void updateTimeStamp() { final long remoteTimestamp = connection.getLastModified(); if (verbose) { final Date t = new Date(remoteTimestamp); log("last modified = " + t.toString() + ((remoteTimestamp == 0) ? " - using current time instead" : ""), logLevel); } if (remoteTimestamp != 0) { FILE_UTILS.setFileLastModified(dest, remoteTimestamp); } }
/** * Call File.setLastModified(long time) on Java above 1.1, and logs * a warning on Java 1.1. * * @param file The file to set the last modified time on. * Must not be <code>null</code>. * * @param time the required modification time. * * @deprecated since 1.4.x * * @exception BuildException if the last modified time cannot be set * despite running on a platform with a version * above 1.1. */ @Deprecated public void setFileLastModified(final File file, final long time) throws BuildException { FILE_UTILS.setFileLastModified(file, time); log("Setting modification time for " + file, MSG_VERBOSE); }
private void touch(File file, long modTime) { if (!file.exists()) { log("Creating " + file, ((verbose) ? Project.MSG_INFO : Project.MSG_VERBOSE)); try { FILE_UTILS.createNewFile(file, mkdirs); } catch (IOException ioe) { throw new BuildException("Could not create " + file, ioe, getLocation()); } } if (!file.canWrite()) { throw new BuildException( "Can not change modification date of read-only file %s", file); } FILE_UTILS.setFileLastModified(file, modTime); }
FILE_UTILS.rename(temp, f); if (preserveLastModified) { FILE_UTILS.setFileLastModified(f, origLastModified);
fileUtils.setFileLastModified(f, entryDate.getTime()); } catch (FileNotFoundException ex) { log("Unable to expand to file " + f.getPath(),
log("preserved lastModified for " + destFile, Project.MSG_DEBUG); FILE_UTILS.setFileLastModified(destFile, lastModified);
FILE_UTILS.rename(temp, src); if (preserveLastModified) { FILE_UTILS.setFileLastModified(src, origLastModified);
FILE_UTILS.setFileLastModified(targetFile, lastModified);
fileUtils.setFileLastModified( f, entryDate.getTime() );
FileUtils.getFileUtils().setFileLastModified(localFile, ((long) le.getAttrs().getMTime()) * 1000);
private void setLastModified(final File localFile) throws JSchException { SftpATTRS fileAttributes = null; final ChannelSftp channel = openSftpChannel(); channel.connect(); try { fileAttributes = channel.lstat(remoteDir(remoteFile) + localFile.getName()); } catch (final SftpException e) { throw new JSchException("failed to stat remote file", e); } FileUtils.getFileUtils().setFileLastModified(localFile, ((long) fileAttributes.getMTime()) * 1000); }
FTPFile[] remote = ftp.listFiles(resolveFile(filename)); if (remote.length > 0) { FILE_UTILS.setFileLastModified(file, remote[0].getTimestamp() .getTime().getTime());
FTPFile[] remote = ftp.listFiles(resolveFile(filename)); if (remote.length > 0) { FILE_UTILS.setFileLastModified(file, remote[0].getTimestamp() .getTime().getTime());
FTPFile[] remote = ftp.listFiles(resolveFile(filename)); if (remote.length > 0) { FILE_UTILS.setFileLastModified(file, remote[0].getTimestamp() .getTime().getTime());
FTPFile[] remote = ftp.listFiles(resolveFile(filename)); if (remote.length > 0) { FILE_UTILS.setFileLastModified(file, remote[0].getTimestamp() .getTime().getTime());