1 16 17 package de.schlichtherle.io.archive.zip.raes; 18 19 import de.schlichtherle.io.archive.zip.*; 20 import de.schlichtherle.io.rof.*; 21 22 import java.io.*; 23 import java.util.zip.*; 24 25 53 public class SafeZip32RaesDriver extends AbstractZip32RaesDriver { 54 55 62 private static final long AUTHENTICATION_TRIGGER = 512 * 1024; 63 64 public SafeZip32RaesDriver() { 65 super(AUTHENTICATION_TRIGGER); 66 } 67 68 protected Zip32InputArchive createZip32InputArchive( 69 ReadOnlyFile rof, 70 String encoding, 71 boolean preambled, 72 boolean postambled) 73 throws NullPointerException , 74 UnsupportedEncodingException, 75 FileNotFoundException, 76 ZipException, 77 IOException { 78 return rof.length() > getAuthenticationTrigger() 85 ? new CheckedZip32InputArchive(rof, encoding, preambled, postambled) 86 : new Zip32InputArchive(rof, encoding, preambled, postambled); 87 } 88 89 protected Zip32OutputArchive createZip32OutputArchive( 90 final OutputStream out, 91 final String encoding, 92 final Zip32InputArchive source) 93 throws NullPointerException , 94 UnsupportedEncodingException, 95 IOException { 96 return new Zip32OutputArchive(out, encoding, source); 97 } 98 } 99 | Popular Tags |