janhoy commented on a change in pull request #560:
URL: https://github.com/apache/solr/pull/560#discussion_r793333070



##########
File path: solr/core/src/java/org/apache/solr/pkg/PackageLoader.java
##########
@@ -78,29 +82,31 @@
   public PackageLoader(CoreContainer coreContainer) {
     this.coreContainer = coreContainer;
 
-    List<String> enabledPackages = StrUtils.splitSmart(localPkgsWhiteList, 
',');
+    List<String> enabledPackages = StrUtils.splitSmart(enabledLocalPkgsList, 
',');
     packageAPI = new PackageAPI(coreContainer, this);
 
     if (localPkgsDir != null && !enabledPackages.isEmpty()) {
-      loadLocalPackages(enabledPackages);
+      loadLocalPackages(localPkgsDir, enabledPackages);
+    }
+    if (repoPackagesEnabled) {
+      refreshPackageConf();
     }
-    if (enablePackages) refreshPackageConf();
   }
 
-  private void loadLocalPackages(List<String> enabledPackages) {
-    final Path packagesPath = new File(localPkgsDir.charAt(0)== 
File.separatorChar?
-            localPkgsDir :
-            coreContainer.getSolrHome()+ File.separator+ 
localPkgsDir).toPath();
+  private void loadLocalPackages(String localPkgsDir,  List<String> 
enabledPackages) {
+    final Path packagesPath = localPkgsDir.charAt(0) == File.separatorChar ?
+            Paths.get(localPkgsDir) :
+            Paths.get(coreContainer.getSolrHome()).resolve(localPkgsDir);
     log.info("Packages to be loaded from directory: {}", packagesPath);
 
-    if (!packagesPath.toFile().exists()) {
+    if (!Files.exists(packagesPath)) {

Review comment:
       Is there or will there be another way than sysProp to set the local 
packages dir? If it can be set by some api, it should be checked against 
allowPaths in cc.




-- 
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-unsubscr...@solr.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to