use of org.commonjava.maven.galley.io.SpecialPathConstants.HTTP_METADATA_EXT in project indy by Commonjava.
the class DefaultContentManager method doRetrieve.
private Transfer doRetrieve(final ArtifactStore store, final String path, final EventMetadata eventMetadata) throws IndyWorkflowException {
logger.trace("Attempting to retrieve: {} from: {}", path, store.getKey());
if (store.isDisabled()) {
logger.debug("Content not available in repository due to store disabled for {}, path is {}", store, path);
return null;
}
Transfer item = null;
try {
item = downloadManager.retrieve(store, path, eventMetadata);
if (item == null) {
item = contentGeneratorManager.generateFileContentAnd(store, path, eventMetadata, transfer -> {
logger.debug("Resource generated for {}, clean NFC and delete obsolete http-metadata.json", transfer.getResource());
nfc.clearMissing(transfer.getResource());
Transfer httpMeta = transfer.getSiblingMeta(HTTP_METADATA_EXT);
try {
httpMeta.delete();
} catch (IOException e) {
logger.warn("Failed to delete {}", httpMeta.getResource());
}
});
}
} catch (IndyWorkflowException e) {
e.filterLocationErrors();
}
return item;
}
Aggregations