if (synonymProviderConfigPath.endsWith(FileSystem.SEPARATOR)) {
throw new FileSystemException(
"Invalid synonymProviderConfigPath: "
+ synonymProviderConfigPath);
}
FileSystem fs = getContext().getFileSystem();
if (fs == null) {
fs = new LocalFileSystem();
int lastSeparator = synonymProviderConfigPath.lastIndexOf(
FileSystem.SEPARATOR_CHAR);
if (lastSeparator != -1) {
File root = new File(path,
synonymProviderConfigPath.substring(0, lastSeparator));
((LocalFileSystem) fs).setRoot(root.getCanonicalFile());
fs.init();
fsr = new FileSystemResource(fs,
synonymProviderConfigPath.substring(lastSeparator + 1));
} else {
((LocalFileSystem) fs).setPath(path);
fs.init();
fsr = new FileSystemResource(fs, synonymProviderConfigPath);
}
synonymProviderConfigFs = fs;
} else {
fsr = new FileSystemResource(fs, synonymProviderConfigPath);