ftp.chdir(testdir);
// get modtime
log.debug("Existing modtime on existing file: " + remoteTextFile);
Date modTime = ftp.modtime(remoteTextFile);
log.debug(remoteTextFile + ": " + modTime.toString());
// set modtime
Calendar cal = Calendar.getInstance();
cal.setTime(modTime);
cal.add(Calendar.DAY_OF_YEAR, 1);
cal.add(Calendar.HOUR_OF_DAY, 2);
cal.add(Calendar.MINUTE, 3);
cal.add(Calendar.SECOND, 4);
Date desiredModTime = cal.getTime();
log.debug("Setting mod-time to " + desiredModTime.toString());
ftp.setModTime(remoteTextFile, desiredModTime);
Date actualModTime = ftp.modtime(remoteTextFile);
log.debug(remoteTextFile + ": " + actualModTime.toString());
if ((int)desiredModTime.getTime()/1000 != (int)actualModTime.getTime()/1000)
{
String msg = "Desired mod-time(" + desiredModTime + ") != actual mod-time(" + actualModTime + ")";
log.debug(msg);
fail(msg);
}