Skip to content

Apache Lucene open-source search software

SOLR-1930: remove Config and ResourceLoader deprecations

Yonik Seeley8fb5053a8418
diff --git a/solr/src/java/org/apache/solr/core/Config.java b/solr/src/java/org/apache/solr/core/Config.java
index 78601dd0281..c0c530bd943 100644
--- a/solr/src/java/org/apache/solr/core/Config.java
+++ b/solr/src/java/org/apache/solr/core/Config.java
@@ -51,15 +51,6 @@ public class Config {
private final String name;
private final SolrResourceLoader loader;
- /**
- * @deprecated Use {@link #Config(SolrResourceLoader, String, InputStream, String)} instead.
- */
- @Deprecated
- public Config(String name, InputStream is, String prefix) throws ParserConfigurationException, IOException, SAXException
- {
- this( null, name, is, prefix );
- }
-
/**
* Builds a config from a resource name with no xpath prefix.
* @param loader
@@ -310,55 +301,4 @@ public class Config {
return version;
}
-
- // The following functions were moved to ResourceLoader
- //-----------------------------------------------------------------------------
-
- /**
- * @deprecated Use {@link SolrResourceLoader#getConfigDir()} instead.
- */
- @Deprecated
- public String getConfigDir() {
- return loader.getConfigDir();
- }
-
- /**
- * @deprecated Use {@link SolrResourceLoader#openResource(String)} instead.
- */
- @Deprecated
- public InputStream openResource(String resource) {
- return loader.openResource(resource);
- }
-
- /**
- * @deprecated Use {@link SolrResourceLoader#getLines(String)} instead.
- */
- @Deprecated
- public List<String> getLines(String resource) throws IOException {
- return loader.getLines(resource);
- }
-
- /**
- * @deprecated Use {@link SolrResourceLoader#findClass(String, String[])} instead.
- */
- @Deprecated
- public Class findClass(String cname, String... subpackages) {
- return loader.findClass(cname, subpackages);
- }
-
- /**
- * @deprecated Use {@link SolrResourceLoader#newInstance(String, String[])} instead.
- */
- @Deprecated
- public Object newInstance(String cname, String ... subpackages) {
- return loader.newInstance(cname, subpackages);
- }
-
- /**
- * @deprecated Use {@link SolrResourceLoader#getInstanceDir()} instead.
- */
- @Deprecated
- public String getInstanceDir() {
- return loader.getInstanceDir();
- }
}
diff --git a/solr/src/java/org/apache/solr/core/SolrResourceLoader.java b/solr/src/java/org/apache/solr/core/SolrResourceLoader.java
index 3d8dfdaee1d..7d0d10d5d7d 100644
--- a/solr/src/java/org/apache/solr/core/SolrResourceLoader.java
+++ b/solr/src/java/org/apache/solr/core/SolrResourceLoader.java
@@ -636,10 +636,7 @@ public class SolrResourceLoader implements ResourceLoader
}
return normalizeDir( home );
}
- @Deprecated
- public static String locateInstanceDir() {
- return locateSolrHome();
- }
+
public String getInstanceDir() {
return instanceDir;
diff --git a/solr/src/webapp/src/org/apache/solr/servlet/DirectSolrConnection.java b/solr/src/webapp/src/org/apache/solr/servlet/DirectSolrConnection.java
index 51a553d4f46..28943a9df97 100644
--- a/solr/src/webapp/src/org/apache/solr/servlet/DirectSolrConnection.java
+++ b/solr/src/webapp/src/org/apache/solr/servlet/DirectSolrConnection.java
@@ -64,54 +64,6 @@ public class DirectSolrConnection
core = c;
parser = new SolrRequestParsers( c.getSolrConfig() );
}
-
- /**
- * This constructor is designed to make it easy for JNI embedded applications
- * to setup the entire solr environment with a simple interface. It takes three parameters:
- *
- * <code>instanceDir:</code> The solr instance directory. If null, it will check the standard
- * places first (JNDI,properties,"solr" directory)
- *
- * <code>dataDir:</code> where the index is stored.
- *
- * <code>loggingPath:</code> Path to a java.util.logging.config.file. If the path represents
- * an absolute path or is relative to the CWD, it will use that. Next it will try a path
- * relative to the instanceDir. If none of these files exist, it will error.
- */
- public DirectSolrConnection( String instanceDir, String dataDir, String loggingPath )
- {
- // If a loggingPath is specified, try using that (this needs to happen first)
- if( loggingPath != null ) {
- File loggingConfig = new File( loggingPath );
- if( !loggingConfig.exists() && instanceDir != null ) {
- loggingConfig = new File( new File(instanceDir), loggingPath );
- }
- if( loggingConfig.exists() ) {
- System.setProperty("java.util.logging.config.file", loggingConfig.getAbsolutePath() );
- }
- else {
- throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "can not find logging file: "+loggingConfig );
- }
- }
-
- if( instanceDir == null ) {
- instanceDir = SolrResourceLoader.locateInstanceDir();
- }
-
- // Initialize
- try {
- CoreContainer cores = new CoreContainer(new SolrResourceLoader(instanceDir));
- SolrConfig solrConfig = new SolrConfig(instanceDir, SolrConfig.DEFAULT_CONF_FILE, null);
- CoreDescriptor dcore = new CoreDescriptor(cores, "", solrConfig.getResourceLoader().getInstanceDir());
- IndexSchema indexSchema = new IndexSchema(solrConfig, instanceDir+"/conf/schema.xml", null);
- core = new SolrCore( null, dataDir, solrConfig, indexSchema, dcore);
- cores.register("", core, false);
- parser = new SolrRequestParsers( solrConfig );
- }
- catch (Exception ee) {
- throw new RuntimeException(ee);
- }
- }
/**
diff --git a/solr/src/webapp/web/admin/_info.jsp b/solr/src/webapp/web/admin/_info.jsp
index 90fc2d4628a..22e9a7fca87 100644
--- a/solr/src/webapp/web/admin/_info.jsp
+++ b/solr/src/webapp/web/admin/_info.jsp
@@ -114,7 +114,7 @@
}
String cwd=System.getProperty("user.dir");
- String solrHome= solrConfig.getInstanceDir();
+ String solrHome= solrConfig.getResourceLoader().getInstanceDir();
boolean cachingEnabled = !solrConfig.getHttpCachingConfig().isNever304();
%>