KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > izforge > izpack > compressor > BZip2PackCompressor


1 /*
2  * $Id: BZip2PackCompressor.java 1708 2007-01-13 18:31:26Z jponge $
3  * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
4  *
5  * http://www.izforge.com/izpack/
6  * http://developer.berlios.de/projects/izpack/
7  *
8  * Copyright 2005 Klaus Bartz
9  *
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 JavaDoc;
25
26
27 /**
28  * IzPack will be able to support different compression methods for the
29  * packs included in the installation jar file.
30  * This class implements the PackCompressor for the compression format "bzip2".
31  *
32  * @author Klaus Bartz
33  */

34 public class BZip2PackCompressor extends PackCompressorBase
35 {
36
37     private static final String JavaDoc [] THIS_FORMAT_NAMES = {"bzip2"};
38     private static final String JavaDoc [] THIS_CONTAINER_PATH = {"lib/ant.jar"};
39     private static final String JavaDoc THIS_DECODER_MAPPER = "org.apache.tools.bzip2.CBZip2InputStream";
40     private static final String JavaDoc [][] THIS_DECODER_CLASS_NAMES =
41         {{ "org.apache.tools.bzip2.BZip2Constants.*" ,
42           "org.apache.tools.bzip2.CBZip2InputStream.*",
43           "org.apache.tools.bzip2.CRC.*"
44         }};
45     private static final String JavaDoc THIS_ENCODER_CLASS_NAME = "org.apache.tools.bzip2.CBZip2OutputStream";
46
47     /**
48      *
49      */

50     public BZip2PackCompressor()
51     {
52         super();
53         formatNames = THIS_FORMAT_NAMES;
54         containerPaths = THIS_CONTAINER_PATH;
55         decoderMapper = THIS_DECODER_MAPPER;
56         decoderClassNames = THIS_DECODER_CLASS_NAMES;
57         encoderClassName = THIS_ENCODER_CLASS_NAME;
58     }
59
60     /* (non-Javadoc)
61      * @see com.izforge.izpack.compressor.PackCompressor#getOutputStream(java.io.OutputStream)
62      */

63     public OutputStream JavaDoc getOutputStream(OutputStream JavaDoc os) throws Exception JavaDoc
64     {
65         // TODO Auto-generated method stub
66

67         return( getOutputInstance(os));
68     }
69
70 }
71
Popular Tags