All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.schlichtherle.truezip.fs.archive.zip.CheckedZipDriver Maven / Gradle / Ivy

Go to download

The file system driver family for ZIP and related archive file types. Add the JAR artifact of this module to the run time class path to make its file system drivers available for service location in the client API modules.

There is a newer version: 7.7.10
Show newest version
/*
 * Copyright (C) 2005-2013 Schlichtherle IT Services.
 * All rights reserved. Use is subject to license terms.
 */
package de.schlichtherle.truezip.fs.archive.zip;

import de.schlichtherle.truezip.socket.IOPoolProvider;
import javax.annotation.concurrent.Immutable;

/**
 * An archive driver for ZIP files which checks the CRC-32 values for all
 * ZIP entries in input archives.
 * The additional CRC-32 computation makes this class slower than its super
 * class.
 * 

* If there is a mismatch of the CRC-32 values for a ZIP entry in an input * archive, the {@link java.io.InputStream#close} method of the corresponding * stream for the archive entry will throw a * {@link de.schlichtherle.truezip.zip.CRC32Exception}. * Other than this, the archive entry will be processed normally. * So if just the CRC-32 value for the entry in the archive file has been * modified, you can still read its entire contents. *

* Subclasses must be thread-safe and should be immutable! * * @author Christian Schlichtherle */ @Immutable public class CheckedZipDriver extends ZipDriver { public CheckedZipDriver(IOPoolProvider provider) { super(provider); } /** * {@inheritDoc} * * @return {@code true} */ @Override protected boolean check(ZipInputShop input, ZipDriverEntry entry) { return true; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy