home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIPHEFT062001.ISO / browser / nc32lyc / comm.z / java40.jar / netscape / softupdate / FolderSpec.class (.txt) next >
Encoding:
Java Class File  |  2000-08-15  |  1.7 KB  |  66 lines

  1. package netscape.softupdate;
  2.  
  3. final class FolderSpec {
  4.    private String folderID;
  5.    private String versionRegistryPath;
  6.    private String userPackageName;
  7.    private String urlPath;
  8.  
  9.    FolderSpec(String var1, String var2, String var3) {
  10.       this.folderID = var1;
  11.       this.versionRegistryPath = var2;
  12.       this.userPackageName = var3;
  13.  
  14.       try {
  15.          this.SetDirectoryPath();
  16.       } catch (SoftUpdateException var4) {
  17.          this.urlPath = null;
  18.       }
  19.    }
  20.  
  21.    void SetDirectoryPath() throws SoftUpdateException {
  22.       if (this.folderID.equalsIgnoreCase("User Pick")) {
  23.          this.urlPath = this.PickDefaultDirectory();
  24.       } else if (this.folderID.equalsIgnoreCase("Installed")) {
  25.          this.urlPath = this.versionRegistryPath;
  26.       } else {
  27.          this.urlPath = this.NativeGetDirectoryPath(this.folderID);
  28.       }
  29.    }
  30.  
  31.    String GetDirectoryPath() {
  32.       return this.urlPath;
  33.    }
  34.  
  35.    String MakeFullPath(String var1) throws SoftUpdateException {
  36.       String var2 = this.GetDirectoryPath() + this.GetNativePath(var1);
  37.       return var2;
  38.    }
  39.  
  40.    private native String NativeGetDirectoryPath(String var1);
  41.  
  42.    private native String GetNativePath(String var1);
  43.  
  44.    private String PickDefaultDirectory() throws SoftUpdateException {
  45.       this.urlPath = this.NativePickDefaultDirectory();
  46.       if (this.urlPath == null) {
  47.          throw new SoftUpdateException(this.folderID, -219);
  48.       } else {
  49.          return this.urlPath;
  50.       }
  51.    }
  52.  
  53.    private native String NativePickDefaultDirectory() throws SoftUpdateException;
  54.  
  55.    boolean IsJavaCapable() {
  56.       return this.NativeIsJavaDir();
  57.    }
  58.  
  59.    private native boolean NativeIsJavaDir();
  60.  
  61.    public String toString() {
  62.       String var1 = this.GetDirectoryPath();
  63.       return var1;
  64.    }
  65. }
  66.