FileDocCategorySizeDatePackage
ZipFileSystemView.javaAPI DocExample2376Mon Jan 09 11:01:58 GMT 2006None

ZipFileSystemView

public class ZipFileSystemView extends FileSystemView

Fields Summary
Constructors Summary
public ZipFileSystemView()

 
Methods Summary
public java.io.FilecreateFileObject(java.io.File dir, java.lang.String filename)

        if(dir instanceof ZipEntryFileProxy) {
            ZipEntryFileProxy zdir = (ZipEntryFileProxy) dir;
            return new ZipEntryFileProxy(zdir.zip, zdir.zipfile, filename, dir);
        }
        return super.createFileObject(dir,filename);
    
public java.io.FilecreateNewFolder(java.io.File file)

 return null; 
public java.io.FilegetChild(java.io.File dir, java.lang.String filename)

        if(dir instanceof ZipEntryFileProxy) {
            ZipEntryFileProxy zdir = (ZipEntryFileProxy) dir;
            return new ZipEntryFileProxy(zdir.zip,zdir.zipfile,dir.getPath()+filename,dir);
        }
        return super.getChild(dir,filename);
    
public java.io.File[]getFiles(java.io.File dir, boolean useFileHiding)

        if(dir.getName().endsWith(".zip")) {
            ZipFileProxy proxy = new ZipFileProxy(dir);
            File[] fs = proxy.getFiles("");
            return fs;
        }
        
        if(dir instanceof ZipEntryFileProxy) {
            return dir.listFiles();
        }
        
        return super.getFiles(dir,useFileHiding);
    
public java.io.FilegetParentDirectory(java.io.File dir)

        if(dir instanceof ZipEntryFileProxy) {
            return dir.getParentFile();
        }
        return super.getParentDirectory(dir);
    
public java.lang.StringgetSystemDisplayName(java.io.File f)

        if(f instanceof ZipEntryFileProxy) {
            return f.getName();
        }
        return super.getSystemDisplayName(f);
    
public java.lang.BooleanisTraversable(java.io.File f)

        if(f.getName().endsWith(".zip")) {
            return new Boolean(true);
        }
        if(f instanceof ZipEntryFileProxy) {
            boolean b = ((ZipEntryFileProxy)f).isDirectory();
            return new Boolean(b);
        }
        return super.isTraversable(f);