Skip to content

Commit adadd42

Browse files
authored
[MRESOLVER-536] Do not belly up if FS does not support setting mtime (#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
1 parent 31df8a3 commit adadd42

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import java.nio.charset.Charset;
3232
import java.nio.file.Files;
3333
import java.nio.file.StandardCopyOption;
34-
import java.nio.file.attribute.FileTime;
3534
import java.util.Collections;
3635
import java.util.Date;
3736
import java.util.HashSet;
@@ -691,8 +690,7 @@ public void handle(CloseableHttpResponse response) throws IOException, TransferC
691690
if (lastModifiedHeader != null) {
692691
Date lastModified = DateUtils.parseDate(lastModifiedHeader.getValue());
693692
if (lastModified != null) {
694-
Files.setLastModifiedTime(
695-
task.getDataFile().toPath(), FileTime.fromMillis(lastModified.getTime()));
693+
task.getDataFile().setLastModified(lastModified.getTime());
696694
}
697695
}
698696
}

0 commit comments

Comments
 (0)