I want to access an artifact (zip File containing a delivery) uploaded to a sonaytype nexus 2.14.0-01 to unzip it in a tmp directory and examine its content.
I am able to hook into the on handle request for the create action, however, at that time the artifact is not yet uploaded to the repository.
public void onHandle(Repository repository, ResourceStoreRequest resourceStoreRequest, Action action) throws ItemNotFoundException, IllegalOperationException
{
log.info("got onHandle Request for " + repository.toString() + " " + action.toString() + " " + resourceStoreRequest.toString());
log.info("that is the file to process: " + resourceStoreRequest.getRequestPath());
}
Log entries:
2016-10-11 18:01:23,760+0200 INFO [qtp1685232414-73] admin DeliveryRequestProcessor - got onHandle Request for M2Repository(id=deliveries) create ResourceStoreRequest{requestPath='/fakepath/configurationmanagement/0.1/configurationmanagement-0.1.zip', requestContext=RequestContext{this=org.sonatype.nexus.proxy.RequestContext@3476eab3, parent=null}, pathStack=[], processedRepositories=[], appliedMappings={}}(GAVCE=fakepath:configurationmanagement:0.1:c=null:e=zip, for "deliveries" [id=deliveries])
but a call for
repository.getLocalStorage().retrieveItem(repository,resourceStoreRequest)
is failing (naturally).
Is there any advice on what hook to use after a file is uploaded and can be processed?
Best regards, Eduard