"Error requesting URL Resource Model Source: " + configuration.nodesUrl + ": " + e.getMessage(), e);
} else {
logger.error("Error requesting URL Resource Model Source: " + configuration.nodesUrl + ": " + e.getMessage(), e);
}
}
final ResourceFormatParser parser;
if ("file".equalsIgnoreCase(configuration.nodesUrl.getProtocol())) {
try {
parser = framework.getResourceFormatParserService().getParserForFileExtension(new File(
configuration.nodesUrl.toURI()));
} catch (UnsupportedFormatException e) {
throw new ResourceModelSourceException(
"Error requesting URL Resource Model Source: " + configuration.nodesUrl + ": No supported format available for file extension", e);
} catch (URISyntaxException e) {
throw new ResourceModelSourceException(
"Error requesting URL Resource Model Source: " + configuration.nodesUrl + ": " + e.getMessage(), e);
}
logger.debug("Determined URL content format from file name: " + configuration.nodesUrl);
} else {
final String mimetype = updater.getContentType();
try {
parser = framework.getResourceFormatParserService().getParserForMIMEType(mimetype);
} catch (UnsupportedFormatException e) {
throw new ResourceModelSourceException(
"Error requesting URL Resource Model Source: " + configuration.nodesUrl
+ ": Response content type is not supported: " + mimetype, e);
}
logger.debug("Determined URL content format from MIME type: " + mimetype);
}
if (destinationTempFile.isFile() && destinationTempFile.length() > 0) {
try {
return parser.parseDocument(destinationTempFile);
} catch (ResourceFormatParserException e) {
throw new ResourceModelSourceException(
"Error requesting URL Resource Model Source: " + configuration.nodesUrl
+ ": Content could not be parsed: "+e.getMessage(),e);
}