KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > schlichtherle > io > archive > zip > raes > ParanoidZip32RaesDriver


1 /*
2  * Copyright 2006 Schlichtherle IT Services
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

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 /**
26  * A paranoid archive driver which builds RAES encrypted ZIP32 archives.
27  * This driver <em>always</em> checks the cipher text of input archive files
28  * using the RAES Message Authentication Code (MAC), which makes it slower than
29  * the {@link SafeZip32RaesDriver} for archive files larger than 512 KB and
30  * may block the client application on the first access to the archive for
31  * quite a while if it's really large.
32  * Note that the CRC-32 value of the plain text ZIP file is never checked
33  * because this is made redundant by the MAC verification.
34  * <p>
35  * Instances of this class are immutable.
36  *
37  * @see SafeZip32RaesDriver
38  * @author Christian Schlichtherle
39  * @version @version@
40  * @since TrueZIP 6.0
41  */

42 public class ParanoidZip32RaesDriver extends AbstractZip32RaesDriver {
43
44     protected Zip32InputArchive createZip32InputArchive(
45             ReadOnlyFile rof,
46             String JavaDoc encoding,
47             boolean preambled,
48             boolean postambled)
49     throws NullPointerException JavaDoc,
50             UnsupportedEncodingException,
51             FileNotFoundException,
52             ZipException,
53             IOException {
54         return new Zip32InputArchive(rof, encoding, preambled, postambled);
55     }
56
57     protected Zip32OutputArchive createZip32OutputArchive(
58             final OutputStream out,
59             final String JavaDoc encoding,
60             final Zip32InputArchive source)
61     throws NullPointerException JavaDoc,
62             UnsupportedEncodingException,
63             IOException {
64         return new Zip32OutputArchive(out, encoding, source);
65     }
66 }
67
Popular Tags