KickJava   Java API By Example, From Geeks To Geeks.

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


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  * An unsafe archive driver which builds RAES encrypted ZIP32 archives.
27  * This class only authenticates the cipher key and file length, which makes
28  * it comparably fast.
29  * However, it does <em>not</em> check the cipher text of input archives and
30  * does <em>not</em> check the CRC-32 values of the encrypted archive entries,
31  * so it's completely unsafe.
32  * <p>
33  * Instances of this class are immutable.
34  *
35  * @deprecated This class exists for testing purposes only.
36  * You should never use this class - use {@link SafeZip32RaesDriver}
37  * instead.
38  * @see SafeZip32RaesDriver
39  * @see ParanoidZip32RaesDriver
40  * @author Christian Schlichtherle
41  * @version @version@
42  * @since TrueZIP 6.0
43  */

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