File handlerFile = null;
try {
handlerFile = this.getHandlerConfig(handlerName).getFile();
} catch (NullPointerException e) {
LOGGER.error("Resource for handler: " + handlerName + " not found. Returning");
throw new PlatformException("File not found for handler: " + handlerName, e);
} catch (IOException e) {
LOGGER.error("Handler Config File for handler: " + handlerName + " not found. Returning");
throw new PlatformException("File not found for handler: " + handlerName, e);
}
// Check if file actually exists
if (!handlerFile.exists()) {
LOGGER.error("Handler Config File: " + handlerFile.getAbsolutePath() + " doesn't exist. Returning");
throw new PlatformException("File not found: " + handlerFile.getAbsolutePath());
}
// Check for read permissions
if (!handlerFile.canRead()) {
LOGGER.error("No read permission for: " + handlerFile.getAbsolutePath() + ". Returning");
throw new PlatformException("Read permissions not found for file: " + handlerFile.getAbsolutePath());
}
// get the registered AbstractHandler for the file name
T handler = this.configURItoHandlerName.get(handlerFile.toURI()).get(0);