KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > vfs > provider > gzip > GzipFileProvider


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

16 package org.apache.commons.vfs.provider.gzip;
17
18 import org.apache.commons.vfs.Capability;
19 import org.apache.commons.vfs.FileName;
20 import org.apache.commons.vfs.FileObject;
21 import org.apache.commons.vfs.FileSystem;
22 import org.apache.commons.vfs.FileSystemException;
23 import org.apache.commons.vfs.FileSystemOptions;
24 import org.apache.commons.vfs.provider.compressed.CompressedFileFileProvider;
25
26 import java.util.Arrays JavaDoc;
27 import java.util.Collection JavaDoc;
28 import java.util.Collections JavaDoc;
29
30 /**
31  * Provides access to the content of gzip compressed files
32  *
33  * @author <a HREF="mailto:imario@apache.org">Mario Ivankovits</a>
34  */

35 public class GzipFileProvider extends CompressedFileFileProvider
36 {
37     protected final static Collection JavaDoc capabilities = Collections.unmodifiableCollection(Arrays.asList(new Capability[]
38     {
39         Capability.GET_LAST_MODIFIED,
40         Capability.GET_TYPE,
41         Capability.LIST_CHILDREN,
42         Capability.WRITE_CONTENT,
43         Capability.READ_CONTENT,
44         Capability.URI,
45         Capability.COMPRESS
46     }));
47
48     public GzipFileProvider()
49     {
50         super();
51     }
52
53     protected FileSystem createFileSystem(FileName name, FileObject file, FileSystemOptions fileSystemOptions) throws FileSystemException
54     {
55         return new GzipFileSystem(name, file, fileSystemOptions);
56     }
57
58     public Collection JavaDoc getCapabilities()
59     {
60         return capabilities;
61     }
62 }
63
Popular Tags