You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "matthiasblaesing (via GitHub)" <gi...@apache.org> on 2023/03/13 20:37:56 UTC

[GitHub] [netbeans] matthiasblaesing commented on a diff in pull request #5655: Improved maven indexer failure modes in low space situations

matthiasblaesing commented on code in PR #5655:
URL: https://github.com/apache/netbeans/pull/5655#discussion_r1134587277


##########
java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java:
##########
@@ -585,45 +594,33 @@ private void indexLoadedRepo(final RepositoryInfo repo, boolean updateLocal) thr
                     }
                 }
             }
-        } catch (IOException e) {            
+        } catch (IOException e) {
             if(e.getCause() instanceof ResourceDoesNotExistException) {
                 fireChange(repo, () -> repo.fireNoIndex());
             }
-            File tmpFolder = Places.getCacheDirectory();
-            // see also issue #250365
-            String noSpaceLeftMsg = null;
-            if(e.getMessage() != null && e.getMessage().contains("No space left on device")) {
-                noSpaceLeftMsg = Bundle.MSG_NoSpace(tmpFolder.getAbsolutePath(), repo.getName());
-            }
-            
-            long downloaded = listener != null ? listener.getUnits() * 1024 : -1;
-            long usableSpace = -1;
-            try {
-                FileStore store = Files.getFileStore(tmpFolder.toPath());
-                usableSpace = store.getUsableSpace();                    
-            } catch (IOException ex) {
-                Exceptions.printStackTrace(ex);
-            }
-            LOGGER.log(Level.INFO, "Downloaded maven index file has size {0} (zipped). The usable space in {1} is {2}.", new Object[]{downloaded, tmpFolder, usableSpace});
+            Path tmpFolder = Paths.get(System.getProperty("java.io.tmpdir"));

Review Comment:
   At a later time we might allow people to choose a different path for the temp files. If here the `tmpFolder` is initialized from `tmpStorage`, this would be easier to update and kept consistent. The variable might not yet initalized though or intialized to `null`. 



-- 
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: notifications-unsubscribe@netbeans.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists