/** * {@inheritDoc} */ @Override public final IdentificationRequest<InputStream> newRequest(RequestMetaData metaData, RequestIdentifier identifier) { return new TarEntryIdentificationRequest(metaData, identifier, getTempDirLocation()); }
/** * {@inheritDoc} */ @Override public final void open(InputStream in) throws IOException { reader = ResourceUtils.getStreamReader(in, tempDir, TOP_TAIL_CAPACITY, false); // Force read of entire input stream to build reader and remove dependence on source input stream. final long readSize = reader.length(); // getting the size of a reader backed by a stream forces a stream read. if (readSize != size) { String resourceIdentifier = ""; if (getIdentifier() != null && getIdentifier().getUri() != null) { resourceIdentifier = getIdentifier().getUri().toString(); } log.warn("The tar entry " + resourceIdentifier + " states it is " + size + " in length, but reading it produced: " + readSize); size = readSize; } }
/** * {@inheritDoc} */ @Override public final IdentificationRequest<InputStream> newRequest(RequestMetaData metaData, RequestIdentifier identifier) { return new TarEntryIdentificationRequest(metaData, identifier, getTempDirLocation()); }
/** * {@inheritDoc} */ @Override public final void open(InputStream in) throws IOException { reader = ResourceUtils.getStreamReader(in, tempDir, TOP_TAIL_CAPACITY, false); // Force read of entire input stream to build reader and remove dependence on source input stream. final long readSize = reader.length(); // getting the size of a reader backed by a stream forces a stream read. if (readSize != size) { String resourceIdentifier = ""; if (getIdentifier() != null && getIdentifier().getUri() != null) { resourceIdentifier = getIdentifier().getUri().toString(); } log.warn("The tar entry " + resourceIdentifier + " states it is " + size + " in length, but reading it produced: " + readSize); size = readSize; } }
final RequestIdentifier identifier = new RequestIdentifier(uri); final TarEntryIdentificationRequest tarRequest = new TarEntryIdentificationRequest(metaData, identifier, getTmpDir()); expandContainer(tarRequest, in, newPath);