log.error("Null filehandle was returned for " + configID);
throw new IllegalArgumentException("Null filehandle was returned for " + configID);
}
PluginType pluginData = metadata.get(configID);
// Only bother with the hash if we got it from a source other than the download file itself
HashType hash = pluginData == null ? null : pluginData.getPluginArtifact().get(0).getHash();
if (hash != null) {
String actual = ConfigurationStoreUtil.getActualChecksum(tempFile, hash.getType());
if (!actual.equals(hash.getValue())) {
log.error("File download incorrect (expected {} hash {} but got {})", new String[]{hash.getType(), hash.getValue(), actual});
throw new IOException("File download incorrect (expected " + hash.getType() + " hash " + hash.getValue() + " but got " + actual + ")");
}
}
// See if the download file has plugin metadata and use it in preference to what is in the catalog.
try {
PluginType realPluginData = GeronimoSourceRepository.extractPluginMetadata(tempFile);