Skip to content

Apache Lucene open-source search software

SOLR-4699: The System admin handler should not assume a file system based data directory location.

Mark Robert Millerf9d36d9fda12
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 2c394fd41cb..a0607d73753 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -175,6 +175,8 @@ Bug Fixes
* SOLR-4581: When faceting on numeric fields in Solr 4.2, negative values (constraints)
were sorted incorrectly. (Alexander Buhr, shalin, yonik)
+* SOLR-4699: The System admin handler should not assume a file system based data directory
+ location. (Mark Miller)
Optimizations
----------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
index e8034c302b8..4eb0bb0d561 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
@@ -106,7 +106,12 @@ public class SystemInfoHandler extends RequestHandlerBase
SimpleOrderedMap<Object> dirs = new SimpleOrderedMap<Object>();
dirs.add( "cwd" , new File( System.getProperty("user.dir")).getAbsolutePath() );
dirs.add( "instance", new File( core.getResourceLoader().getInstanceDir() ).getAbsolutePath() );
- dirs.add( "data", new File( core.getDataDir() ).getAbsolutePath() );
+ try {
+ dirs.add( "data", core.getDirectoryFactory().normalize(core.getDataDir()));
+ } catch (IOException e) {
+ log.warn("Problem getting the normalized data directory path", e);
+ dirs.add( "data", "N/A" );
+ }
dirs.add( "dirimpl", core.getDirectoryFactory().getClass().getName());
try {
dirs.add( "index", core.getDirectoryFactory().normalize(core.getIndexDir()) );