home *** CD-ROM | disk | FTP | other *** search
/ Tutto per Internet / Internet.iso / soft95 / Java / espints / espinst.exe / classes / espresso / GeneralFile.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-02-28  |  1.2 KB  |  43 lines

  1. package espresso;
  2.  
  3. import java.io.File;
  4. import java.io.IOException;
  5. import java.util.Hashtable;
  6.  
  7. abstract class GeneralFile {
  8.    private static Hashtable opened = new Hashtable();
  9.  
  10.    static GeneralFile open(String var0, String var1) {
  11.       if (var0 == null) {
  12.          return new PlainFile(new File(var1));
  13.       } else if (var0.endsWith(".zip")) {
  14.          Object var2 = (GeneralFile)opened.get(var0);
  15.          if (var2 == null) {
  16.             var2 = new ZipDir(new File(var0));
  17.             if (((GeneralFile)var2).isDirectory()) {
  18.                opened.put(var0, var2);
  19.             }
  20.          }
  21.  
  22.          return ((GeneralFile)var2).open(var1);
  23.       } else {
  24.          return new PlainFile(new File(var0, var1));
  25.       }
  26.    }
  27.  
  28.    abstract GeneralFile open(String var1);
  29.  
  30.    abstract String[] list() throws IOException;
  31.  
  32.    abstract byte[] read() throws IOException;
  33.  
  34.    abstract boolean isDirectory();
  35.  
  36.    abstract boolean exists();
  37.  
  38.    abstract String getPath();
  39.  
  40.    public GeneralFile() {
  41.    }
  42. }
  43.