KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: DefaultPackCompressor.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 /**
29  * IzPack will be able to support different compression methods for the
30  * packs included in the installation jar file.
31  * This class implements the PackCompressor for the compression format "default"
32  * which is current the LZ77 implementation of zlib (also known as
33  * zip or deflate).
34  *
35  * @author Klaus Bartz
36  */

37 public class DefaultPackCompressor extends PackCompressorBase
38 {
39     private static final String JavaDoc [] THIS_FORMAT_NAMES =
40     {"default", "deflate", "zip", "lz77"};
41     private static final String JavaDoc [] THIS_CONTAINER_PATH = null;
42     private static final String JavaDoc THIS_DECODER_MAPPER = null;
43     private static final String JavaDoc [][] THIS_DECODER_CLASS_NAMES = null;
44     private static final String JavaDoc THIS_ENCODER_CLASS_NAME = null;
45
46
47     /**
48      *
49      */

50     public DefaultPackCompressor()
51     {
52         super();
53         formatNames = THIS_FORMAT_NAMES;
54         containerPaths = THIS_CONTAINER_PATH;
55         decoderMapper = THIS_DECODER_MAPPER;
56         encoderClassName = THIS_ENCODER_CLASS_NAME;
57         decoderClassNames = THIS_DECODER_CLASS_NAMES;
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)
64     {
65         // This will crash the packager if implementation is wrong :-)
66
return(null);
67     }
68
69     /* (non-Javadoc)
70      * @see com.izforge.izpack.compressor.PackCompressor#useStandardCompression()
71      */

72     public boolean useStandardCompression()
73     {
74         return(true);
75     }
76     /* (non-Javadoc)
77      * @see com.izforge.izpack.compressor.PackCompressor#needsBufferedOutputStream()
78      */

79     public boolean needsBufferedOutputStream()
80     {
81         return(false);
82     }
83
84 }
85
Popular Tags