/**
* {@inheritDoc}
*/
@Override
public final void handle(IdentificationRequest request) throws IOException {
IdentificationRequest archiveRequest = null;
InputStream in = request.getSourceInputStream();
try {
URI parent = request.getIdentifier().getUri();
long correlationId = request.getIdentifier().getNodeId();
final URI uri = ArchiveFileUtils.toGZipUri(parent);
String path = uri.getSchemeSpecificPart();
String fileName = FilenameUtils.getName(path);
final RequestMetaData metaData = new RequestMetaData(null, null, fileName);
RequestIdentifier identifier = new RequestIdentifier(uri);
identifier.setAncestorId(request.getIdentifier().getAncestorId());
identifier.setParentId(correlationId);
archiveRequest = factory.newRequest(metaData, identifier);
final InputStream gzin = new GZIPInputStream(in);
try {
archiveRequest.open(gzin);
} finally {
if (gzin != null) {
gzin.close();
}
}