madrob commented on a change in pull request #1191: SOLR-14197 Reduce API of 
SolrResourceLoader
URL: https://github.com/apache/lucene-solr/pull/1191#discussion_r384812253
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/core/SolrPaths.java
 ##########
 @@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.core;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.naming.NoInitialContextException;
+import java.io.File;
+import java.lang.invoke.MethodHandles;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Set;
+import java.util.concurrent.ConcurrentSkipListSet;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Utility methods about about paths in Solr.
+ */
+public class SolrPaths {
+  private static final Logger log = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  /**
+   * Solr allows users to store arbitrary files in a special directory located 
directly under SOLR_HOME.
+   * <p>
+   * This directory is generally created by each node on startup.  Files 
located in this directory can then be
+   * manipulated using select Solr features (e.g. streaming expressions).
+   */
+  public static final String USER_FILES_DIRECTORY = "userfiles";
+  private static final Set<String> loggedOnce = new ConcurrentSkipListSet<>();
+
+  private SolrPaths() {} // don't create this
+
+  /**
+   * Finds the solrhome based on looking up the value in one of three places:
+   * <ol>
+   * <li>JNDI: via java:comp/env/solr/home</li>
+   * <li>The system property solr.solr.home</li>
+   * <li>Look in the current working directory for a solr/ directory</li>
+   * </ol>
+   * <p>
+   * The return value is normalized.  Normalization essentially means it ends 
in a trailing slash.
+   *
+   * @return A normalized solrhome
+   * @see #normalizeDir(String)
+   */
+  public static Path locateSolrHome() {
 
 Review comment:
   I'm assuming this is a verbatim copy from the old code, so I'm not looking 
at it too closely. Let me know if that's not the case.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to