KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > schlichtherle > io > archive > zip > ReadOnlySfxDriver


1 /*
2  * ReadOnlySfxDriver.java
3  *
4  * Created on 24. Dezember 2005, 00:01
5  */

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

21
22 package de.schlichtherle.io.archive.zip;
23
24 import de.schlichtherle.io.archive.Archive;
25 import de.schlichtherle.io.archive.spi.InputArchive;
26 import de.schlichtherle.io.archive.spi.OutputArchive;
27 import java.io.FileNotFoundException JavaDoc;
28 import java.io.IOException JavaDoc;
29 import java.io.OutputStream JavaDoc;
30 import java.io.UnsupportedEncodingException JavaDoc;
31 import java.util.logging.Level JavaDoc;
32 import java.util.logging.Logger JavaDoc;
33
34 /**
35  * A {@link Zip32Driver} which reads Self Executable (SFX) ZIP32 archives,
36  * but doesn't allow you to create or update them.
37  * <p>
38  * Instances of this class are immutable.
39  *
40  * @see CheckedReadOnlySfxDriver
41  *
42  * @author Christian Schlichtherle
43  * @version @version@
44  * @since TrueZIP 6.0
45  */

46 public class ReadOnlySfxDriver extends AbstractSfxDriver {
47
48     /**
49      * Equivalent to {@link #ReadOnlySfxDriver(String)
50      * ReadOnlySfxDriver(ENCODING)}.
51      * This parameter is based on heuristics.
52      */

53     public ReadOnlySfxDriver() {
54         this(ENCODING);
55     }
56
57     /**
58      * Equivalent to
59      * {@link AbstractSfxDriver#AbstractSfxDriver(String, boolean, boolean, Icon, Icon)
60      * super(encoding, true, false, null, null)}.
61      * These parameters are based on heuristics.
62      */

63     public ReadOnlySfxDriver(String JavaDoc encoding) {
64         super(encoding, true, false, null, null);
65     }
66
67     public OutputArchive createOutputArchive(
68             final Archive archive,
69             final OutputStream JavaDoc out,
70             final InputArchive source)
71     throws FileNotFoundException JavaDoc {
72         throw new FileNotFoundException JavaDoc(
73                 "This driver does not allow modifying SFX archives in order to prevent breaking potential integrity checks in the SFX code!");
74     }
75 }
76
Popular Tags