janhoy commented on a change in pull request #525:
URL: https://github.com/apache/solr/pull/525#discussion_r784928616
##########
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 was a little weary about returning null here. Alternatives would be
String which could be "" or `Optional<Path>` but since solr.install.dir is
always set, both in a normal run and in test, that is a corner case I did not
bother with.
--
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]