01: /*
02: * $Id: BZip2PackCompressor.java 2036 2008-02-09 11:14:05Z jponge $
03: * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
04: *
05: * http://izpack.org/
06: * http://izpack.codehaus.org/
07: *
08: * Copyright 2005 Klaus Bartz
09: *
10: * Licensed under the Apache License, Version 2.0 (the "License");
11: * you may not use this file except in compliance with the License.
12: * You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software
17: * distributed under the License is distributed on an "AS IS" BASIS,
18: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19: * See the License for the specific language governing permissions and
20: * limitations under the License.
21: */
22: package com.izforge.izpack.compressor;
23:
24: import java.io.OutputStream;
25:
26: /**
27: * IzPack will be able to support different compression methods for the
28: * packs included in the installation jar file.
29: * This class implements the PackCompressor for the compression format "bzip2".
30: *
31: * @author Klaus Bartz
32: */
33: public class BZip2PackCompressor extends PackCompressorBase {
34:
35: private static final String[] THIS_FORMAT_NAMES = { "bzip2" };
36: private static final String[] THIS_CONTAINER_PATH = { "lib/ant.jar" };
37: private static final String THIS_DECODER_MAPPER = "org.apache.tools.bzip2.CBZip2InputStream";
38: private static final String[][] THIS_DECODER_CLASS_NAMES = { {
39: "org.apache.tools.bzip2.BZip2Constants.*",
40: "org.apache.tools.bzip2.CBZip2InputStream.*",
41: "org.apache.tools.bzip2.CRC.*" } };
42: private static final String THIS_ENCODER_CLASS_NAME = "org.apache.tools.bzip2.CBZip2OutputStream";
43:
44: /**
45: *
46: */
47: public BZip2PackCompressor() {
48: super ();
49: formatNames = THIS_FORMAT_NAMES;
50: containerPaths = THIS_CONTAINER_PATH;
51: decoderMapper = THIS_DECODER_MAPPER;
52: decoderClassNames = THIS_DECODER_CLASS_NAMES;
53: encoderClassName = THIS_ENCODER_CLASS_NAME;
54: }
55:
56: /* (non-Javadoc)
57: * @see com.izforge.izpack.compressor.PackCompressor#getOutputStream(java.io.OutputStream)
58: */
59: public OutputStream getOutputStream(OutputStream os)
60: throws Exception {
61: // TODO Auto-generated method stub
62:
63: return (getOutputInstance(os));
64: }
65:
66: }
|