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

  1. package espresso;
  2.  
  3. import java.io.File;
  4. import java.io.FileInputStream;
  5. import java.io.IOException;
  6.  
  7. class PlainFile extends GeneralFile {
  8.    // $FF: renamed from: f java.io.File
  9.    File field_0;
  10.  
  11.    GeneralFile open(String var1) {
  12.       return new PlainFile(new File(this.field_0, var1));
  13.    }
  14.  
  15.    String[] list() throws IOException {
  16.       return this.field_0.list();
  17.    }
  18.  
  19.    byte[] read() throws IOException {
  20.       FileInputStream var1 = new FileInputStream(this.field_0);
  21.       byte[] var2 = new byte[var1.available()];
  22.       if (var1.read(var2) != var2.length) {
  23.          throw new IOException("read error");
  24.       } else {
  25.          var1.close();
  26.          return var2;
  27.       }
  28.    }
  29.  
  30.    boolean isDirectory() {
  31.       return this.field_0.isDirectory();
  32.    }
  33.  
  34.    boolean exists() {
  35.       return this.field_0.exists();
  36.    }
  37.  
  38.    String getPath() {
  39.       return this.field_0.getPath();
  40.    }
  41.  
  42.    PlainFile(File var1) {
  43.       this.field_0 = var1;
  44.    }
  45. }
  46.