KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * AbstractSfxDriver.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.IOException JavaDoc;
28 import java.io.OutputStream JavaDoc;
29 import java.io.UnsupportedEncodingException JavaDoc;
30 import java.util.logging.Level JavaDoc;
31 import java.util.logging.Logger JavaDoc;
32 import javax.swing.Icon JavaDoc;
33
34 /**
35  * An archive driver which builds Self Executable (SFX) ZIP32 archives.
36  * <p>
37  * Instances of this class are immutable.
38  *
39  * @author Christian Schlichtherle
40  * @version @version@
41  * @since TrueZIP 6.0
42  */

43 abstract public class AbstractSfxDriver extends Zip32Driver {
44
45     private static final String JavaDoc CLASS_NAME
46             = "de/schlichtherle/io/archive/zip/AbstractSfxDriver".replace('/', '.'); // beware of code obfuscation!
47

48     /**
49      * The character set encoding used in SFX archives.
50      * This is the platform's default encoding, as returned by
51      * {@link System#getProperty(String) System.getProperty("file.encoding")}.
52      */

53     public static final String JavaDoc ENCODING = System.getProperty("file.encoding");
54
55     static {
56         Logger.getLogger(CLASS_NAME, CLASS_NAME).log(Level.CONFIG, "encoding", ENCODING);
57     }
58
59     /**
60      * Equivalent to {@link Zip32Driver#Zip32Driver(String, boolean, boolean, Icon, Icon)
61      * super(ENCODING, true, false, null, null)}.
62      * These parameters are based on heuristics.
63      */

64     public AbstractSfxDriver() {
65         super(ENCODING, true, false, null, null);
66     }
67
68     /**
69      * Equivalent to {@link Zip32Driver#Zip32Driver(String, boolean, boolean, Icon, Icon)
70      * super(encoding, true, false, null, null)}.
71      * These parameters are based on heuristics.
72      */

73     public AbstractSfxDriver(String JavaDoc encoding) {
74         super(encoding, true, false, null, null);
75     }
76
77     /**
78      * Equivalent to {@link Zip32Driver#Zip32Driver(String, boolean, boolean, Icon, Icon)
79      * super(encoding, preambled, postambled, openIcon, closedIcon)}.
80      */

81     public AbstractSfxDriver(
82             String JavaDoc encoding,
83             boolean preambled,
84             boolean postambled,
85             Icon JavaDoc openIcon,
86             Icon JavaDoc closedIcon) {
87         super(encoding, preambled, postambled, openIcon, closedIcon);
88     }
89
90     abstract public OutputArchive createOutputArchive(
91             final Archive archive,
92             final OutputStream JavaDoc out,
93             final InputArchive source)
94     throws UnsupportedEncodingException JavaDoc, IOException JavaDoc;
95 }
96
Popular Tags