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:
Shalin Shekhar Mangar 2009-02-23 13:41:43 +00:00
parent 6ae1c862f4
commit e9ec6b2fa9
1 changed files with 5 additions and 5 deletions

View File

@ -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) {