/** * {@inheritDoc} */ @Override public final ZipEntryIdentificationRequest newRequest(RequestMetaData metaData, RequestIdentifier identifier) { return new ZipEntryIdentificationRequest(metaData, identifier, getTempDirLocation()); }
/** * {@inheritDoc} */ @Override public final void open(final InputStream in) throws IOException { reader = ResourceUtils.getStreamReader(in, tempDir, TOP_TAIL_CAPACITY, closeStream); // 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) { //Sometimes ZipEntry don't contain information about length,crc, .... //For more details : "ZipArchiveInputStream vs ZipFile" apache commons-compress documentation. String resourceIdentifier = ""; if (getIdentifier() != null && getIdentifier().getUri() != null) { resourceIdentifier = getIdentifier().getUri().toString(); } log.info("The zip entry " + resourceIdentifier + " states it is " + size + " in length, but reading it produced: " + readSize); size = readSize; } }
/** * {@inheritDoc} */ @Override public final void open(final InputStream in) throws IOException { reader = ResourceUtils.getStreamReader(in, tempDir, TOP_TAIL_CAPACITY, closeStream); // 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) { //Sometimes ZipEntry don't contain information about length,crc, .... //For more details : "ZipArchiveInputStream vs ZipFile" apache commons-compress documentation. String resourceIdentifier = ""; if (getIdentifier() != null && getIdentifier().getUri() != null) { resourceIdentifier = getIdentifier().getUri().toString(); } log.info("The zip entry " + resourceIdentifier + " states it is " + size + " in length, but reading it produced: " + readSize); size = readSize; } }
/** * {@inheritDoc} */ @Override public final ZipEntryIdentificationRequest newRequest(RequestMetaData metaData, RequestIdentifier identifier) { return new ZipEntryIdentificationRequest(metaData, identifier, getTempDirLocation()); }
final RequestIdentifier identifier = new RequestIdentifier(uri); final ZipEntryIdentificationRequest zipRequest = new ZipEntryIdentificationRequest(metaData, identifier, getTmpDir(), false); expandContainer(zipRequest, in, newPath);