home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VPage / Java.bin / CLASSES.ZIP / sun / net / www / protocol / systemresource / ParseSystemURL.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-07-08  |  1.1 KB  |  49 lines

  1. package sun.net.www.protocol.systemresource;
  2.  
  3. import java.net.URL;
  4.  
  5. class ParseSystemURL {
  6.    private String base;
  7.    private String member;
  8.    private boolean isAFile;
  9.    private boolean isInZip;
  10.  
  11.    public boolean isValid() {
  12.       return this.isAFile || this.isInZip;
  13.    }
  14.  
  15.    public boolean isFile() {
  16.       return this.isAFile;
  17.    }
  18.  
  19.    public boolean isZip() {
  20.       return this.isInZip;
  21.    }
  22.  
  23.    public String getBase() {
  24.       return this.base;
  25.    }
  26.  
  27.    public String getMember() {
  28.       return this.member;
  29.    }
  30.  
  31.    public ParseSystemURL(URL var1) {
  32.       String var2 = var1.getFile();
  33.       if (var2.startsWith("/FILE")) {
  34.          this.isAFile = true;
  35.          var2 = var2.substring(5);
  36.       } else {
  37.          if (!var2.startsWith("/ZIP")) {
  38.             return;
  39.          }
  40.  
  41.          this.isInZip = true;
  42.          var2 = var2.substring(4);
  43.       }
  44.  
  45.       this.base = var2.substring(0, var2.indexOf("/+/"));
  46.       this.member = var2.substring(var2.indexOf("/+/") + 3);
  47.    }
  48. }
  49.