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() {
|
||||
if (dataDir == null) return getDefaultDataDir();
|
||||
String absolutePath = new File(dataDir).getAbsolutePath();
|
||||
if (absolutePath.equals(dataDir) || (absolutePath + File.separator).equals(dataDir)) return dataDir;
|
||||
return dataDir.endsWith(File.separator) ?
|
||||
instanceDir + dataDir :
|
||||
instanceDir + dataDir + File.separator;
|
||||
if (new File(dataDir).isAbsolute()) {
|
||||
return dataDir;
|
||||
} else {
|
||||
return SolrResourceLoader.normalizeDir(instanceDir + dataDir);
|
||||
}
|
||||
}
|
||||
|
||||
public void setDataDir(String s) {
|
||||
|
|
Loading…
Reference in New Issue