Skip to content

Commit

Permalink
[MRESOLVER-536] Do not belly up if FS does not support setting mtime (#…
Browse files Browse the repository at this point in the history
…469)

This seems more logical step, simply use File.setLastModified
as it does not throws, and is used all over the 1.9.x codebase.

---

https://issues.apache.org/jira/browse/MRESOLVER-536
  • Loading branch information
cstamas committed Apr 16, 2024
1 parent 31df8a3 commit adadd42
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.nio.file.attribute.FileTime;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
Expand Down Expand Up @@ -691,8 +690,7 @@ public void handle(CloseableHttpResponse response) throws IOException, TransferC
if (lastModifiedHeader != null) {
Date lastModified = DateUtils.parseDate(lastModifiedHeader.getValue());
if (lastModified != null) {
Files.setLastModifiedTime(
task.getDataFile().toPath(), FileTime.fromMillis(lastModified.getTime()));
task.getDataFile().setLastModified(lastModified.getTime());
}
}
}
Expand Down

0 comments on commit adadd42

Please sign in to comment.