rmannibucau commented on code in PR #468:
URL: https://github.com/apache/maven-resolver/pull/468#discussion_r1566966120
##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/io/PathProcessor.java:
##########
@@ -46,6 +48,26 @@ default long lastModified(Path path, long defValue) {
}
}
+ /**
+ * Sets last modified of path in milliseconds, if exists.
+ *
+ * @param path The path, may be {@code null}.
+ * @throws UncheckedIOException If an I/O error occurs.
+ * @return {@code true} if timestamp was successfully set, {@code false}
otherwise. Reasons of {@code false} may
+ * be multiple, from file not found, to FS not supporting the setting the
TS.
+ * @since TBD
+ */
+ default boolean setLastModified(Path path, long value) {
+ try {
+ Files.setLastModifiedTime(path, FileTime.fromMillis(value));
+ return true;
+ } catch (FileSystemException e) {
+ return false; // not found Ex belongs here as well
Review Comment:
guess `AccessDeniedException` must be thrown - agree others can be ignored
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]