TrueZIP 6.8.2

de.schlichtherle.io.archive.zip
Class CheckedJarDriver

java.lang.Object
  extended by de.schlichtherle.io.archive.spi.AbstractArchiveDriver
      extended by de.schlichtherle.io.archive.zip.ZipDriver
          extended by de.schlichtherle.io.archive.zip.JarDriver
              extended by de.schlichtherle.io.archive.zip.CheckedJarDriver
All Implemented Interfaces:
ArchiveDriver, Serializable

public class CheckedJarDriver
extends JarDriver

An archive driver for JAR files which checks the CRC-32 value 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 InputStream.close() method of the corresponding stream for the archive entry will throw a CRC32Exception. This exception is then propagated through the stack up to the corresponding file operation in the package de.schlichtherle.io where it is either allowed to pass on or is catched and processed accordingly. For example, the FilterInputStream.close() method would allow the CRC32Exception to pass on to the client application, whereas the File.catTo(OutputStream) method would simply return false. 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.

Instances of this class are immutable.

Since:
TrueZIP 6.1
Version:
$Id: CheckedJarDriver.java 06f3ba684701 2010/11/04 01:15:55 christian $
Author:
Christian Schlichtherle
See Also:
CheckedZipInputArchive, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class de.schlichtherle.io.archive.spi.AbstractArchiveDriver
AbstractArchiveDriver.InconsistentCharsetSupportError
 
Field Summary
private static long serialVersionUID
           
 
Fields inherited from class de.schlichtherle.io.archive.zip.JarDriver
DEFAULT_CHARSET
 
Fields inherited from class de.schlichtherle.io.archive.zip.ZipDriver
DEFAULT_LEVEL, TEMP_FILE_PREFIX
 
Constructor Summary
CheckedJarDriver()
          Equivalent to this(null, null, false, false, DEFAULT_LEVEL).
CheckedJarDriver(Icon openIcon, Icon closedIcon, boolean preambled, boolean postambled, int level)
          Constructs a new checked JAR driver.
CheckedJarDriver(int level)
          Equivalent to this(null, null, false, false, level).
 
Method Summary
protected  ZipInputArchive createZipInputArchive(Archive archive, ReadOnlyFile rof)
           
 
Methods inherited from class de.schlichtherle.io.archive.zip.JarDriver
createZipEntry, createZipEntry
 
Methods inherited from class de.schlichtherle.io.archive.zip.ZipDriver
createArchiveEntry, createInputArchive, createOutputArchive, createZip32InputArchive, createZip32OutputArchive, createZipOutputArchive, getLevel, getPostambled, getPreambled
 
Methods inherited from class de.schlichtherle.io.archive.spi.AbstractArchiveDriver
ensureEncodable, getCharset, getClosedIcon, getEncoding, getOpenIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.schlichtherle.io.archive.spi.ArchiveDriver
equals, hashCode
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

CheckedJarDriver

public CheckedJarDriver()
Equivalent to this(null, null, false, false, DEFAULT_LEVEL).


CheckedJarDriver

public CheckedJarDriver(int level)
Equivalent to this(null, null, false, false, level).


CheckedJarDriver

public CheckedJarDriver(Icon openIcon,
                        Icon closedIcon,
                        boolean preambled,
                        boolean postambled,
                        int level)
Constructs a new checked JAR driver.

Method Detail

createZipInputArchive

protected ZipInputArchive createZipInputArchive(Archive archive,
                                                ReadOnlyFile rof)
                                         throws IOException
Overrides:
createZipInputArchive in class JarDriver
Throws:
IOException

TrueZIP 6.8.2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.