JAL-1807
[jalview.git] / site / j2s / jssun / security / action / GetPropertyAction.js
diff --git a/site/j2s/jssun/security/action/GetPropertyAction.js b/site/j2s/jssun/security/action/GetPropertyAction.js
new file mode 100644 (file)
index 0000000..6a384ee
--- /dev/null
@@ -0,0 +1,22 @@
+Clazz.declarePackage ("jssun.security.action");
+Clazz.load (["java.security.PrivilegedAction"], "jssun.security.action.GetPropertyAction", null, function () {
+c$ = Clazz.decorateAsClass (function () {
+this.theProp = null;
+this.defaultVal = null;
+Clazz.instantialize (this, arguments);
+}, jssun.security.action, "GetPropertyAction", null, java.security.PrivilegedAction);
+Clazz.makeConstructor (c$, 
+function (theProp) {
+this.theProp = theProp;
+}, "~S");
+Clazz.makeConstructor (c$, 
+function (theProp, defaultVal) {
+this.theProp = theProp;
+this.defaultVal = defaultVal;
+}, "~S,~S");
+Clazz.overrideMethod (c$, "run", 
+function () {
+var value = System.getProperty (this.theProp);
+return (value == null ? this.defaultVal : value);
+});
+});