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



##########
File path: solr/core/src/java/org/apache/solr/core/NodeConfig.java
##########
@@ -206,7 +208,16 @@ public Path getSolrDataHome() {
     return solrDataHome;
   }
 
-  /** 
+  /**
+   * Obtain the path of solr's binary installation directory, e.g. 
<code>/opt/solr</code>
+   * @return path to install dir, or null if property 'solr.install.dir' has 
not been initialized
+   */
+  public Path getSolrInstallDir() {
+    String prop = 
System.getProperty(SolrDispatchFilter.SOLR_INSTALL_DIR_ATTRIBUTE);
+    return prop != null ? Paths.get(prop) : null;

Review comment:
       I also thought of not adding this method to `NodeConfig` and instead use 
`System.getProperty` directly where you need it - like is done other places in 
the code base. But it IS a node configuration and fits nicely in there. Wdyt?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to