home *** CD-ROM | disk | FTP | other *** search
- package netscape.softupdate;
-
- import netscape.security.Target;
-
- final class FolderSpec {
- private String urlPath = null;
- private String folderID;
- private String versionRegistryPath;
- private String userPackageName;
- static final int INVALID_PATH_ERR = -100;
- static final int USER_CANCELLED_ERR = -101;
-
- FolderSpec(String var1, String var2, String var3) {
- this.folderID = var1;
- this.versionRegistryPath = var2;
- this.userPackageName = var3;
- }
-
- String GetDirectoryPath() throws SoftUpdateException {
- Object var1 = null;
- if (this.urlPath == null) {
- if (this.folderID.compareTo("User Pick") == 0) {
- this.urlPath = VersionRegistry.getDefaultDirectory(this.versionRegistryPath);
- if (this.urlPath == null) {
- this.PickDefaultDirectory();
- }
- } else if (this.folderID.compareTo("Installed") == 0) {
- this.urlPath = this.versionRegistryPath;
- } else {
- int var2 = this.NativeGetDirectoryPath();
- if (var2 != 0) {
- throw new SoftUpdateException(this.folderID, var2);
- }
- }
- }
-
- String var3 = this.urlPath;
- return var3;
- }
-
- String MakeFullPath(String var1) throws SoftUpdateException {
- if (this.GetSecurityTargetID() == 0 && var1.regionMatches(0, "..", 0, 2)) {
- throw new SoftUpdateException(Strings.error_IllegalPath(), -209);
- } else {
- String var2 = this.GetDirectoryPath() + this.GetNativePath(var1);
- return var2;
- }
- }
-
- private native int NativeGetDirectoryPath();
-
- private native String GetNativePath(String var1);
-
- private void PickDefaultDirectory() throws SoftUpdateException {
- this.urlPath = this.NativePickDefaultDirectory();
- if (this.urlPath == null) {
- throw new SoftUpdateException(this.folderID, -100);
- } else {
- VersionRegistry.setDefaultDirectory(this.versionRegistryPath, this.urlPath);
- }
- }
-
- private native String NativePickDefaultDirectory() throws SoftUpdateException;
-
- Target GetSecurityTarget() {
- int var1 = this.GetSecurityTargetID();
- return Target.findTarget(SoftwareUpdate.targetNames[var1]);
- }
-
- private native int GetSecurityTargetID();
-
- public String toString() {
- String var1;
- try {
- var1 = this.GetDirectoryPath();
- } catch (Exception var2) {
- var1 = null;
- }
-
- return var1;
- }
- }
-