try {
File applicationHome =
(File)context.get(AvalonContextConstants.APPLICATION_HOME);
baseDirectory = applicationHome.toString();
} catch (ContextException ce) {
throw new ContextException("Encountered exception when resolving application home in Avalon context.", ce);
} catch (ClassCastException cce) {
throw new ContextException("Application home object stored in Avalon context was not of type java.io.File.", cce);
}
StringBuffer fileNameBuffer =
new StringBuffer(128)
.append(baseDirectory)
.append(File.separator)
.append(fileName);
fileName = fileNameBuffer.toString();
}
try {
File returnValue = (new File(fileName)).getCanonicalFile();
return returnValue;
} catch (IOException ioe) {
throw new ContextException("Encountered an unexpected exception while retrieving file.", ioe);
}
}