You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "michael-o (via GitHub)" <gi...@apache.org> on 2023/02/25 22:50:45 UTC

[GitHub] [maven-resolver] michael-o commented on a diff in pull request #257: [MRESOLVER-329] More robust IO in DefaultTrackingFileManager

michael-o commented on code in PR #257:
URL: https://github.com/apache/maven-resolver/pull/257#discussion_r1117990047


##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTrackingFileManager.java:
##########
@@ -75,6 +76,8 @@ public Properties update(File file, Map<String, String> updates) {
             if (Files.isReadable(filePath)) {
                 try (InputStream stream = Files.newInputStream(filePath)) {
                     props.load(stream);
+                } catch (NoSuchFileException e) {
+                    // MRESOLVER-329: ignore; in case of concurrent r/w Files.isReadable may return true

Review Comment:
   Please move this to another PR, both issues aren't necessarily related.



##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/FileUtils.java:
##########
@@ -105,7 +106,16 @@ public Path getPath() {
 
             @Override
             public void move() throws IOException {
-                Files.move(tempFile, file, StandardCopyOption.ATOMIC_MOVE);
+                try {
+                    Files.move(tempFile, file, StandardCopyOption.ATOMIC_MOVE);
+                } catch (AccessDeniedException e) {
+                    // MRESOLVER-329: fallback to plain copy+rm, this usually happens on Windows

Review Comment:
   MRESOLVER-325 and not 329



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org