EA-30983 (warn; check file existence; diagnostic)

This commit is contained in:
Roman Shevchenko
2011-11-10 15:42:22 +01:00
parent 202117e207
commit f302587b20
@@ -487,9 +487,9 @@ public abstract class LocalFileSystemBase extends LocalFileSystem {
@Override
public void close() throws IOException {
super.close();
if (timeStamp > 0) {
if (timeStamp > 0 && ioFile.exists()) {
if (!ioFile.setLastModified(timeStamp)) {
LOG.error("Failed: " + file.getPath() + ", " + timeStamp);
LOG.warn("Failed: " + file.getPath() + ", new:" + timeStamp + ", old:" + ioFile.lastModified());
}
}
}
@@ -586,8 +586,9 @@ public abstract class LocalFileSystemBase extends LocalFileSystem {
@Override
public void setTimeStamp(@NotNull final VirtualFile file, final long timeStamp) {
if (!convertToIOFile(file).setLastModified(timeStamp)) {
LOG.error("Failed: " + file.getPath() + ", " + timeStamp);
final File ioFile = convertToIOFile(file);
if (ioFile.exists() && !ioFile.setLastModified(timeStamp)) {
LOG.warn("Failed: " + file.getPath() + ", new:" + timeStamp + ", old:" + ioFile.lastModified());
}
}