1 16 package org.apache.commons.vfs.provider.jar; 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.FileType; 25 import org.apache.commons.vfs.provider.LayeredFileName; 26 import org.apache.commons.vfs.provider.zip.ZipFileProvider; 27 28 import java.util.ArrayList ; 29 import java.util.Arrays ; 30 import java.util.Collection ; 31 import java.util.Collections ; 32 33 40 public class JarFileProvider 41 extends ZipFileProvider 42 { 43 final static Collection capabilities; 44 45 static 46 { 47 Collection combined = new ArrayList (); 48 combined.addAll(ZipFileProvider.capabilities); 49 combined.addAll(Arrays.asList(new Capability[] 50 { 51 Capability.ATTRIBUTES, 52 Capability.FS_ATTRIBUTES, 53 Capability.SIGNING, 54 Capability.MANIFEST_ATTRIBUTES, 55 Capability.VIRTUAL 56 })); 57 capabilities = Collections.unmodifiableCollection(combined); 58 } 59 60 public JarFileProvider() 61 { 62 super(); 63 } 64 65 73 protected FileSystem doCreateFileSystem(final String scheme, 74 final FileObject file, 75 final FileSystemOptions fileSystemOptions) 76 throws FileSystemException 77 { 78 final FileName name = 79 new LayeredFileName(scheme, file.getName(), FileName.ROOT_PATH, FileType.FOLDER); 80 return new JarFileSystem(name, file, fileSystemOptions); 81 } 82 83 public Collection getCapabilities() 84 { 85 return capabilities; 86 } 87 } 88 | Popular Tags |