epugh commented on code in PR #3512:
URL: https://github.com/apache/solr/pull/3512#discussion_r2307829771


##########
solr/core/src/java/org/apache/solr/core/ConfigSetService.java:
##########
@@ -164,6 +162,32 @@ public static Path getDefaultConfigDirPath() {
     return null;
   }
 
+  /**
+   * Resolves a path string into a Path object, handling both absolute and 
relative paths. If the
+   * path is relative and solr.install.dir system property is set, the path is 
resolved against the
+   * Solr installation directory. Otherwise, it's converted to an absolute 
path based on the current
+   * working directory.
+   *
+   * @param pathStr The path string to resolve
+   * @return The resolved Path object
+   * @see SolrDispatchFilter#SOLR_INSTALL_DIR_ATTRIBUTE
+   */
+  public static Path resolvePathWithSolrInstallDir(String pathStr) {
+    Path path = Path.of(pathStr);
+
+    // Convert to absolute path if it's relative and solr.install.dir is set
+    if (!path.isAbsolute()) {
+      String installDir = 
System.getProperty(SolrDispatchFilter.SOLR_INSTALL_DIR_ATTRIBUTE);

Review Comment:
   Yep, makes sense.



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