You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "mbien (via GitHub)" <gi...@apache.org> on 2023/05/01 01:02:01 UTC

[GitHub] [netbeans] mbien commented on a diff in pull request #4999: upgrade to maven-indexer 7.0.1 and improve index downloads

mbien commented on code in PR #4999:
URL: https://github.com/apache/netbeans/pull/4999#discussion_r1181330522


##########
java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java:
##########
@@ -702,6 +723,25 @@ public void indexRepo(final RepositoryInfo repo) {
         }
 
     }
+    
+    private static boolean shouldSkipIndexRequest(RepositoryInfo repo) {
+        if (repo.isRemoteDownloadable()) {
+            if (!RepositoryPreferences.isIndexDownloadEnabledEffective()) {
+                return true;
+            }
+            if (RepositoryPreferences.isIndexDownloadDeniedFor(repo)) {
+                return true;
+            }
+            if (!RepositoryPreferences.isIndexDownloadAllowedFor(repo)) {
+                IndexingNotificationProvider np = Lookup.getDefault().lookup(IndexingNotificationProvider.class);
+                if(np != null) {
+                    np.requestPermissionsFor(repo);
+                }
+                return true;

Review Comment:
   i thought about returning false when no `IndexingNotificationProvider` is found. But it is probably better to add a dummy implementation which simply allows everything. Once all users of this API have their own implementation, the dummy can be removed.
   
   I think it is a better behavior to not a allow downloads by default if there is no provider.



-- 
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