mirror of https://github.com/apache/lucene.git
Use File.isAbsolute for checking absolute path
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@747016 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6ae1c862f4
commit
e9ec6b2fa9
|
@ -85,11 +85,11 @@ public class CoreDescriptor implements Cloneable {
|
||||||
|
|
||||||
public String getDataDir() {
|
public String getDataDir() {
|
||||||
if (dataDir == null) return getDefaultDataDir();
|
if (dataDir == null) return getDefaultDataDir();
|
||||||
String absolutePath = new File(dataDir).getAbsolutePath();
|
if (new File(dataDir).isAbsolute()) {
|
||||||
if (absolutePath.equals(dataDir) || (absolutePath + File.separator).equals(dataDir)) return dataDir;
|
return dataDir;
|
||||||
return dataDir.endsWith(File.separator) ?
|
} else {
|
||||||
instanceDir + dataDir :
|
return SolrResourceLoader.normalizeDir(instanceDir + dataDir);
|
||||||
instanceDir + dataDir + File.separator;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDataDir(String s) {
|
public void setDataDir(String s) {
|
||||||
|
|
Loading…
Reference in New Issue