PageRenderTime 67ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/carrot-jdk7-jnlp-decompile-deploy/src/main/java/com/sun/deploy/config/ClientConfig.java

https://github.com/carrot-garden/carrot-jnlper
Java | 740 lines | 704 code | 32 blank | 4 comment | 206 complexity | cc946655f015f9ac8e39d5475ce9ebb3 MD5 | raw file
  1. package com.sun.deploy.config;
  2. import com.sun.deploy.Environment;
  3. import com.sun.deploy.trace.Trace;
  4. import com.sun.deploy.trace.TraceLevel;
  5. import com.sun.deploy.util.PerfLogger;
  6. import com.sun.deploy.util.SyncFileAccess;
  7. import com.sun.deploy.util.SyncFileAccess.FileInputStreamLock;
  8. import com.sun.deploy.util.SyncFileAccess.FileOutputStreamLock;
  9. import java.io.File;
  10. import java.io.FileInputStream;
  11. import java.io.FileNotFoundException;
  12. import java.io.FileOutputStream;
  13. import java.io.IOException;
  14. import java.io.InputStream;
  15. import java.io.OutputStream;
  16. import java.net.URL;
  17. import java.net.URLConnection;
  18. import java.security.Security;
  19. import java.util.Collection;
  20. import java.util.Enumeration;
  21. import java.util.Properties;
  22. import java.util.Vector;
  23. import javax.net.ssl.HttpsURLConnection;
  24. import sun.net.www.protocol.https.Handler;
  25. class ClientConfig extends Config
  26. {
  27. private boolean _configOK = false;
  28. private Properties _systemProps;
  29. private Properties _internalProps;
  30. private Properties _lockedProps;
  31. protected Properties _changedProps;
  32. private boolean _userConfigStore;
  33. protected boolean _dirty;
  34. private File _userConfigFile;
  35. private SyncFileAccess _userConfigFileSyncAccess;
  36. private String _enterprizeConfig = null;
  37. private long _lastChanged;
  38. public ClientConfig()
  39. {
  40. PerfLogger.setTime("Start Client Config Constructor");
  41. init(null, null);
  42. PerfLogger.setTime("End Client Config Constructor");
  43. }
  44. public Object setProperty(String paramString1, String paramString2)
  45. {
  46. if (isDiskNewer())
  47. refreshIfNeeded();
  48. String str = super.getProperty(paramString1);
  49. if ((paramString2 == null) || (paramString2.length() == 0))
  50. {
  51. if ((containsKey(paramString1)) && (!isInternalProp(paramString1)))
  52. this._dirty = true;
  53. remove(paramString1);
  54. this._changedProps.remove(paramString1);
  55. }
  56. else if (!paramString2.equals(str))
  57. {
  58. if (!isInternalProp(paramString1))
  59. this._dirty = true;
  60. super.setProperty(paramString1, paramString2);
  61. this._changedProps.setProperty(paramString1, paramString2);
  62. }
  63. return str;
  64. }
  65. public boolean init(String paramString1, String paramString2)
  66. {
  67. PerfLogger.setTime("Start ClientConfig.init");
  68. boolean bool = true;
  69. this._systemProps = new Properties();
  70. this._internalProps = getInternalProps();
  71. this._changedProps = new Properties();
  72. this._userConfigStore = false;
  73. if (paramString1 == null)
  74. {
  75. this._userConfigFile = new File(getUserHome() + File.separator + getPropertiesFilename());
  76. this._userConfigStore = true;
  77. }
  78. else if (!paramString1.equals(""))
  79. {
  80. this._userConfigFile = new File(paramString1);
  81. if (!this._userConfigFile.exists())
  82. {
  83. this._userConfigFile = null;
  84. Trace.println("Test user config file given: " + paramString1 + " is non existant", TraceLevel.BASIC);
  85. }
  86. }
  87. else
  88. {
  89. this._userConfigFile = null;
  90. }
  91. if (this._userConfigFile != null)
  92. this._userConfigFileSyncAccess = new SyncFileAccess(this._userConfigFile);
  93. PerfLogger.setTime(" - Start load system properties");
  94. String str1;
  95. String str3;
  96. if (paramString2 == null)
  97. {
  98. localObject1 = new File(getSystemHome() + File.separator + "deployment.config");
  99. if (!((File)localObject1).exists())
  100. localObject1 = new File(Environment.getDeploymentHomePath() + File.separator + "lib" + File.separator + "deployment.config");
  101. if (!((File)localObject1).exists())
  102. localObject1 = new File(Environment.getJavaHome() + File.separator + "lib" + File.separator + "deployment.config");
  103. if (((File)localObject1).exists())
  104. {
  105. localObject2 = loadPropertiesFile(new Properties(), (File)localObject1);
  106. if (localObject2 != null)
  107. {
  108. str1 = ((Properties)localObject2).getProperty("deployment.system.config.mandatory");
  109. int j = (str1 != null) && (!str1.equalsIgnoreCase("false")) ? 1 : 0;
  110. str3 = ((Properties)localObject2).getProperty("deployment.system.config");
  111. this._enterprizeConfig = str3;
  112. if ((str3 != null) && (!tryDownloading(str3, this._systemProps)))
  113. bool = j == 0;
  114. }
  115. }
  116. }
  117. else
  118. {
  119. bool = true;
  120. if (!paramString2.equals(""))
  121. {
  122. localObject1 = new File(paramString2);
  123. if (((File)localObject1).exists())
  124. loadPropertiesFile(this._systemProps, (File)localObject1);
  125. else
  126. Trace.println("Test system config file given: " + paramString2 + " is non existant", TraceLevel.BASIC);
  127. }
  128. }
  129. PerfLogger.setTime(" - End load system properties");
  130. refreshProperties();
  131. PerfLogger.setTime(" - End refreshProperties");
  132. versionUpdateCheck();
  133. PerfLogger.setTime(" - end VersionUpdateCheck");
  134. Object localObject1 = System.getProperties();
  135. PerfLogger.setTime(" - end getting all system properties");
  136. Object localObject2 = propertyNames();
  137. String str2;
  138. while (((Enumeration)localObject2).hasMoreElements())
  139. {
  140. str1 = (String)((Enumeration)localObject2).nextElement();
  141. str2 = getProperty(str1);
  142. if (str2 != null)
  143. ((Properties)localObject1).put(str1, replaceVariables(str2));
  144. }
  145. System.setProperties((Properties)localObject1);
  146. PerfLogger.setTime(" - end setting all system properties");
  147. setPolicyFiles();
  148. if (this._userConfigFile != null)
  149. for (int i = 0; i < PROXY_KEYS.length; i++)
  150. {
  151. str2 = PROXY_KEYS[i];
  152. str3 = "active." + str2;
  153. setProperty(str3, getProperty(str2));
  154. }
  155. PerfLogger.setTime("End Config.init");
  156. this._configOK = bool;
  157. return bool;
  158. }
  159. private void refreshProperties()
  160. {
  161. Properties localProperties1 = new Properties();
  162. Properties localProperties2 = new Properties();
  163. Properties localProperties3 = new Properties();
  164. Properties localProperties4 = new Properties();
  165. Properties localProperties5 = new Properties();
  166. this._lockedProps = new Properties();
  167. clear();
  168. putAll(getDefaults());
  169. if (this._userConfigFile == null)
  170. {
  171. localProperties1.clear();
  172. }
  173. else if (this._userConfigFile.exists())
  174. {
  175. PerfLogger.setTime("Start loadPropertiesFile");
  176. loadPropertiesFile(localProperties1, this._userConfigFile);
  177. PerfLogger.setTime("End loadPropertiesFile");
  178. this._lastChanged = this._userConfigFile.lastModified();
  179. }
  180. else
  181. {
  182. this._lastChanged = System.currentTimeMillis();
  183. }
  184. Enumeration localEnumeration = this._systemProps.keys();
  185. String str1;
  186. String str2;
  187. while (localEnumeration.hasMoreElements())
  188. {
  189. str1 = (String)localEnumeration.nextElement();
  190. str2 = this._systemProps.getProperty(str1);
  191. if (str1.startsWith("deployment.javaws.jre."))
  192. {
  193. localProperties3.setProperty(str1, str2);
  194. }
  195. else if (str1.endsWith(".locked"))
  196. {
  197. int i = str1.length() - ".locked".length();
  198. str1 = str1.substring(0, i);
  199. String str3 = this._systemProps.getProperty(str1);
  200. if (str3 != null)
  201. lockProperty(str1, str3);
  202. }
  203. else if (str1.startsWith("deployment."))
  204. {
  205. setProperty(str1, str2);
  206. }
  207. }
  208. localEnumeration = localProperties1.keys();
  209. while (localEnumeration.hasMoreElements())
  210. {
  211. str1 = (String)localEnumeration.nextElement();
  212. str2 = localProperties1.getProperty(str1);
  213. if (str1.startsWith("deployment.javaws.jre."))
  214. localProperties2.setProperty(str1, str2);
  215. else if (str1.startsWith("deployment.javapi.jre."))
  216. localProperties4.setProperty(str1, str2);
  217. else if (str1.startsWith("deployment.javapi.jdk."))
  218. localProperties5.setProperty(str1, str2);
  219. else if ((str1.startsWith("deployment.")) || (str1.startsWith("javaplugin")))
  220. setProperty(str1, str2);
  221. }
  222. PerfLogger.setTime(" - Start JREInfo.initialize");
  223. JREInfo.initialize(localProperties3, localProperties2);
  224. PerfLogger.setTime(" - End JREInfo.initialize");
  225. JREInfo.importJpiEntries(localProperties4);
  226. PerfLogger.setTime(" - end importing JPI entries");
  227. getInternalPropValues();
  228. localEnumeration = this._lockedProps.keys();
  229. while (localEnumeration.hasMoreElements())
  230. {
  231. str1 = (String)localEnumeration.nextElement();
  232. setProperty(str1, this._lockedProps.getProperty(str1));
  233. }
  234. this._dirty = false;
  235. this._changedProps.clear();
  236. }
  237. public void getInternalPropValues()
  238. {
  239. if (getOSName().equals("Windows"))
  240. {
  241. if ((Platform.get().isPlatformWindowsVista()) || (!Platform.get().hasAdminPrivileges()))
  242. lockProperty("deployment.browser.vm.iexplorer", new Boolean(true).toString());
  243. else
  244. unlockProperty("deployment.browser.vm.iexplorer");
  245. String str = getProperty("deployment.browser.vm.mozilla");
  246. if (!Platform.get().hasAdminPrivileges())
  247. lockProperty("deployment.browser.vm.mozilla", str);
  248. else
  249. unlockProperty("deployment.browser.vm.mozilla");
  250. Collection localCollection = Platform.get().getInstalledJfxRuntimes(true);
  251. if (localCollection.isEmpty())
  252. lockProperty("deployment.javafx.mode.enabled", getProperty("deployment.javafx.mode.enabled"));
  253. else
  254. unlockProperty("deployment.javafx.mode.enabled");
  255. }
  256. if (this._userConfigFile != null)
  257. {
  258. getJavaPlugin();
  259. getJqs();
  260. }
  261. }
  262. private void setPolicyFiles()
  263. {
  264. String str1 = getProperty("deployment.system.security.policy");
  265. if (str1 != null)
  266. str1 = replaceVariables(str1).trim();
  267. String str2 = getProperty("deployment.user.security.policy");
  268. if (str2 != null)
  269. str2 = replaceVariables(str2).trim();
  270. if ((str1 != null) || (str2 != null))
  271. {
  272. int i = 1;
  273. String str3 = null;
  274. while ((str3 = Security.getProperty("policy.url." + i)) != null)
  275. i++;
  276. if (str1 != null)
  277. {
  278. Security.setProperty("policy.url." + i, str1);
  279. i++;
  280. }
  281. if (str2 != null)
  282. {
  283. Security.setProperty("policy.url." + i, str2);
  284. i++;
  285. }
  286. }
  287. }
  288. private boolean tryDownloading(String paramString, Properties paramProperties)
  289. {
  290. URLConnection localURLConnection = null;
  291. try
  292. {
  293. URL localURL = null;
  294. if (paramString.toLowerCase().startsWith("https:"))
  295. localURL = new URL(null, paramString, new Handler());
  296. else
  297. localURL = new URL(paramString);
  298. localURLConnection = localURL.openConnection();
  299. if ((localURLConnection instanceof HttpsURLConnection))
  300. ConfigTrustManager.resetHttpsFactory((HttpsURLConnection)localURLConnection);
  301. InputStream localInputStream = localURLConnection.getInputStream();
  302. paramProperties.load(localInputStream);
  303. int j = 1;
  304. return j;
  305. }
  306. catch (Exception localException)
  307. {
  308. Trace.ignoredException(localException);
  309. int i = 0;
  310. return i;
  311. }
  312. finally
  313. {
  314. if ((localURLConnection != null) && ((localURLConnection instanceof HttpsURLConnection)))
  315. ((HttpsURLConnection)localURLConnection).disconnect();
  316. }
  317. throw localObject;
  318. }
  319. public void refreshUnchangedProps()
  320. {
  321. Properties localProperties = this._changedProps;
  322. refreshProperties();
  323. Enumeration localEnumeration = localProperties.keys();
  324. while (localEnumeration.hasMoreElements())
  325. {
  326. String str = (String)localEnumeration.nextElement();
  327. setProperty(str, localProperties.getProperty(str));
  328. }
  329. }
  330. public boolean isDiskNewer()
  331. {
  332. return (this._userConfigFile != null) && (this._userConfigFile.exists()) && (this._userConfigFile.lastModified() > this._lastChanged);
  333. }
  334. public void storeConfig()
  335. {
  336. if (!this._userConfigStore)
  337. return;
  338. if ((this._dirty) && (isDiskNewer()))
  339. {
  340. localProperties = this._changedProps;
  341. refreshProperties();
  342. localObject1 = localProperties.keys();
  343. while (((Enumeration)localObject1).hasMoreElements())
  344. {
  345. localObject2 = (String)((Enumeration)localObject1).nextElement();
  346. setProperty((String)localObject2, localProperties.getProperty((String)localObject2));
  347. }
  348. }
  349. Properties localProperties = new Properties();
  350. Object localObject1 = new Properties();
  351. Object localObject2 = keys();
  352. Object localObject4;
  353. while (((Enumeration)localObject2).hasMoreElements())
  354. {
  355. localObject3 = (String)((Enumeration)localObject2).nextElement();
  356. if ((!isPropertyLocked((String)localObject3)) && (!isInternalProp((String)localObject3)))
  357. {
  358. String str1 = getProperty((String)localObject3);
  359. String str2 = this._systemProps.getProperty((String)localObject3);
  360. localObject4 = getDefaults().getProperty((String)localObject3);
  361. if ((str1 == null) || ((str2 != null) && (!str1.equals(str2))) || ((str2 == null) && (!str1.equals(localObject4))))
  362. localProperties.setProperty((String)localObject3, str1);
  363. }
  364. }
  365. Object localObject3 = JREInfo.getAll();
  366. int i = 0;
  367. for (int j = 0; j < localObject3.length; j++)
  368. {
  369. if ((localObject3[j].isSystemJRE()) || (Environment.isForcedJreRoot(localObject3[j].getPath())))
  370. continue;
  371. if (localObject3[j].getPlatform() != null)
  372. ((Properties)localObject1).setProperty("deployment.javaws.jre." + i + ".platform", localObject3[j].getPlatform());
  373. if (localObject3[j].getProduct() != null)
  374. ((Properties)localObject1).setProperty("deployment.javaws.jre." + i + ".product", localObject3[j].getProduct());
  375. if (localObject3[j].getLocation() != null)
  376. ((Properties)localObject1).setProperty("deployment.javaws.jre." + i + ".location", localObject3[j].getLocation());
  377. if (localObject3[j].getPath() != null)
  378. ((Properties)localObject1).setProperty("deployment.javaws.jre." + i + ".path", localObject3[j].getPath());
  379. if (localObject3[j].getVmArgs() != null)
  380. ((Properties)localObject1).setProperty("deployment.javaws.jre." + i + ".args", localObject3[j].getVmArgs());
  381. if (localObject3[j].getOSArch() != null)
  382. ((Properties)localObject1).setProperty("deployment.javaws.jre." + i + ".osarch", localObject3[j].getOSArch());
  383. if (localObject3[j].getOSName() != null)
  384. ((Properties)localObject1).setProperty("deployment.javaws.jre." + i + ".osname", localObject3[j].getOSName());
  385. ((Properties)localObject1).setProperty("deployment.javaws.jre." + i + ".enabled", booleanToString(localObject3[j].isEnabled()));
  386. ((Properties)localObject1).setProperty("deployment.javaws.jre." + i + ".registered", booleanToString(localObject3[j].isRegistered()));
  387. i++;
  388. }
  389. this._userConfigFile.getParentFile().mkdirs();
  390. try
  391. {
  392. SyncFileAccess.FileOutputStreamLock localFileOutputStreamLock = this._userConfigFileSyncAccess.openLockFileOutputStream(false, 2000, false);
  393. localObject4 = localFileOutputStreamLock != null ? localFileOutputStreamLock.getFileOutputStream() : new FileOutputStream(this._userConfigFile);
  394. try
  395. {
  396. if (localObject4 != null)
  397. try
  398. {
  399. localProperties.store((OutputStream)localObject4, getPropertiesFilename());
  400. ((Properties)localObject1).store((OutputStream)localObject4, "Java Deployment jre's");
  401. }
  402. catch (IOException localIOException2)
  403. {
  404. Trace.println("Exception: " + localIOException2, TraceLevel.BASIC);
  405. }
  406. }
  407. finally
  408. {
  409. if (localObject4 != null)
  410. {
  411. ((FileOutputStream)localObject4).flush();
  412. try
  413. {
  414. ((FileOutputStream)localObject4).close();
  415. }
  416. catch (IOException localIOException4)
  417. {
  418. }
  419. }
  420. if (localFileOutputStreamLock != null)
  421. localFileOutputStreamLock.release();
  422. }
  423. }
  424. catch (IOException localIOException1)
  425. {
  426. }
  427. this._dirty = false;
  428. this._changedProps.clear();
  429. this._lastChanged = (this._userConfigFile.exists() ? this._userConfigFile.lastModified() : System.currentTimeMillis());
  430. }
  431. private Properties loadPropertiesFile(Properties paramProperties, File paramFile)
  432. {
  433. Object localObject1 = null;
  434. FileInputStream localFileInputStream = null;
  435. try
  436. {
  437. localObject1 = paramFile.equals(this._userConfigFile) ? this._userConfigFileSyncAccess.openLockFileInputStream(1000, false) : null;
  438. localFileInputStream = localObject1 != null ? localObject1.getFileInputStream() : new FileInputStream(paramFile);
  439. paramProperties.load(localFileInputStream);
  440. Properties localProperties = paramProperties;
  441. return localProperties;
  442. }
  443. catch (FileNotFoundException localFileNotFoundException)
  444. {
  445. Trace.println("Cannot find prop file: " + paramFile.getAbsolutePath(), TraceLevel.BASIC);
  446. localObject2 = null;
  447. return localObject2;
  448. }
  449. catch (IOException localIOException1)
  450. {
  451. Trace.println("IO Execption: " + localIOException1, TraceLevel.BASIC);
  452. Object localObject2 = null;
  453. return localObject2;
  454. }
  455. finally
  456. {
  457. if (localFileInputStream != null)
  458. try
  459. {
  460. localFileInputStream.close();
  461. }
  462. catch (IOException localIOException5)
  463. {
  464. }
  465. if (localObject1 != null)
  466. localObject1.release();
  467. }
  468. throw localObject3;
  469. }
  470. private Properties getInternalProps()
  471. {
  472. Properties localProperties = new Properties();
  473. localProperties.setProperty("java.quick.starter", "false");
  474. localProperties.setProperty("deployment.browser.vm.iexplorer", "true");
  475. localProperties.setProperty("deployment.browser.vm.mozilla", "true");
  476. localProperties.setProperty("deployment.javafx.mode.enabled", "true");
  477. localProperties.setProperty("deployment.jpi.mode.new", "true");
  478. return localProperties;
  479. }
  480. public boolean isInternalProp(String paramString)
  481. {
  482. return (this._internalProps.containsKey(paramString)) || (paramString.startsWith("active."));
  483. }
  484. private void versionUpdateCheck()
  485. {
  486. String str1 = "6.0";
  487. if (this._userConfigStore)
  488. str1 = getProperty("deployment.version");
  489. if ((str1 == null) || (str1.compareTo("1.5.0") < 0))
  490. {
  491. Properties localProperties = translateMantisProperties(this);
  492. if (localProperties.getProperty("deployment.javaws.cachedir") == null)
  493. {
  494. localObject = getUserHome() + File.separator + "javaws" + File.separator + "cache";
  495. if (new File((String)localObject).exists())
  496. localProperties.setProperty("deployment.javaws.cachedir", (String)localObject);
  497. }
  498. Object localObject = null;
  499. File localFile1 = new File(getUserHome());
  500. String str2 = localFile1.getParent() + File.separator + ".deployment";
  501. String str3 = str2 + File.separator + "deployment.properties";
  502. File localFile2 = new File(str3);
  503. if (localFile2.exists())
  504. {
  505. localObject = translateMantisProperties(loadPropertiesFile(new Properties(), localFile2));
  506. if (((Properties)localObject).getProperty("deployment.javaws.cachedir") == null)
  507. {
  508. String str4 = str2 + File.separator + "javaws" + File.separator + "cache";
  509. if (new File(str4).exists())
  510. ((Properties)localObject).setProperty("deployment.javaws.cachedir", str4);
  511. }
  512. }
  513. if (localObject != null)
  514. setProperties((Properties)localObject);
  515. if (localProperties != null)
  516. setProperties(localProperties);
  517. setProperty("deployment.browser.path", Platform.get().getBrowserPath());
  518. str1 = "1.5.0";
  519. }
  520. if (str1.compareTo("6.0") < 0)
  521. {
  522. setProperties(translateTigerProperties(this));
  523. setProperty("deployment.version", "6.0");
  524. setBooleanProperty("deployment.javaws.cache.update", true);
  525. setBooleanProperty("deployment.javapi.cache.update", true);
  526. setBooleanProperty("deployment.capture.mime.types", true);
  527. storeIfNeeded();
  528. }
  529. }
  530. private void setProperties(Properties paramProperties)
  531. {
  532. Enumeration localEnumeration = paramProperties.keys();
  533. while (localEnumeration.hasMoreElements())
  534. {
  535. String str = (String)localEnumeration.nextElement();
  536. setProperty(str, paramProperties.getProperty(str));
  537. }
  538. }
  539. private Properties translateMantisProperties(Properties paramProperties)
  540. {
  541. Properties localProperties = new Properties();
  542. Enumeration localEnumeration = paramProperties.keys();
  543. while (localEnumeration.hasMoreElements())
  544. {
  545. str1 = (String)localEnumeration.nextElement();
  546. String str2 = null;
  547. String str3 = paramProperties.getProperty(str1);
  548. if (str1.startsWith("deployment.javaws.proxy"))
  549. {
  550. if (str1.equals("deployment.javaws.proxy.httpport"))
  551. str2 = "deployment.proxy.http.port";
  552. else if (str1.equals("deployment.javaws.proxy.http"))
  553. str2 = "deployment.proxy.http.host";
  554. else if (str1.equals("deployment.javaws.proxy.httpproxyoverride"))
  555. str2 = "deployment.proxy.override.hosts";
  556. }
  557. else if (str1.startsWith("deployment.javaws."))
  558. {
  559. if (str1.equals("deployment.javaws.logFileName"))
  560. str2 = "deployment.javaws.traceFileName";
  561. else if (str1.equals("deployment.javaws.showConsole"))
  562. {
  563. if (str3.equals("true"))
  564. {
  565. str2 = "deployment.console.startup.mode";
  566. str3 = "SHOW";
  567. }
  568. }
  569. else if (str1.equals("deployment.javaws.updateTimeout"))
  570. str2 = "deployment.javaws.update.timeout";
  571. else if (str1.equals("deployment.javaws.version"))
  572. str3 = null;
  573. }
  574. else if (str1.startsWith("javaplugin"))
  575. {
  576. localProperties.setProperty(str1, str3);
  577. if (str1.equals("javaplugin.cache.disabled"))
  578. {
  579. str2 = "deployment.cache.enabled";
  580. str3 = str3.equals("true") ? "false" : "true";
  581. }
  582. else if (str1.equals("javaplugin.cache.size"))
  583. {
  584. str2 = "deployment.cache.max.size";
  585. }
  586. else if (str1.equals("javaplugin.cache.compression"))
  587. {
  588. str2 = "deployment.cache.jarcompression";
  589. }
  590. else if (str1.equals("javaplugin.console"))
  591. {
  592. str2 = "deployment.console.startup.mode";
  593. if (str3.equals("show"))
  594. str3 = "SHOW";
  595. else if (str3.equals("hide"))
  596. str3 = "HIDE";
  597. else
  598. str3 = "DISABLE";
  599. }
  600. else if (str1.equals("javaplugin.exception"))
  601. {
  602. str2 = "deployment.javapi.lifecycle.exception";
  603. }
  604. }
  605. if ((str2 != null) && (str3 != null) && (str3.length() > 0))
  606. localProperties.setProperty(str2, str3);
  607. }
  608. String str1 = paramProperties.getProperty("deployment.javaws.cache.dir");
  609. if (str1 != null)
  610. localProperties.setProperty("deployment.javaws.cachedir", str1);
  611. return localProperties;
  612. }
  613. private Properties translateTigerProperties(Properties paramProperties)
  614. {
  615. Properties localProperties = new Properties();
  616. Enumeration localEnumeration = paramProperties.keys();
  617. while (localEnumeration.hasMoreElements())
  618. {
  619. String str1 = (String)localEnumeration.nextElement();
  620. String str2 = paramProperties.getProperty(str1);
  621. if ((str1.equals("deployment.javaws.associations")) && ((str2.equals("NEW_ONLY")) || (str2.equals("REPLACE_ASK"))))
  622. str2 = "ASK_USER";
  623. localProperties.setProperty(str1, str2);
  624. }
  625. return localProperties;
  626. }
  627. public boolean getJavaPlugin()
  628. {
  629. boolean bool = true;
  630. if (getOSArch().equalsIgnoreCase("amd64"))
  631. {
  632. lockProperty("deployment.jpi.mode.new", "true");
  633. bool = true;
  634. }
  635. else
  636. {
  637. bool = Platform.get().getJavaPluginSettings();
  638. if (!Platform.get().canBecomeAdmin())
  639. lockProperty("deployment.jpi.mode.new", new Boolean(bool).toString());
  640. else
  641. unlockProperty("deployment.jpi.mode.new");
  642. }
  643. setProperty("deployment.jpi.mode.new", new Boolean(bool).toString());
  644. return bool;
  645. }
  646. public boolean getJqs()
  647. {
  648. boolean bool = Platform.get().getJqsSettings();
  649. if (Platform.get().isPlatformWindowsVista())
  650. lockProperty("java.quick.starter", "false");
  651. else
  652. unlockProperty("java.quick.starter");
  653. setProperty("java.quick.starter", new Boolean(bool).toString());
  654. return bool;
  655. }
  656. void lockProperty(String paramString1, String paramString2)
  657. {
  658. if (this._lockedProps == null)
  659. this._lockedProps = new Properties();
  660. this._lockedProps.setProperty(paramString1, paramString2);
  661. }
  662. void unlockProperty(String paramString)
  663. {
  664. if (this._lockedProps != null)
  665. this._lockedProps.remove(paramString);
  666. }
  667. public boolean isPropertyLocked(String paramString)
  668. {
  669. if (this._lockedProps == null)
  670. return false;
  671. return this._lockedProps.containsKey(paramString);
  672. }
  673. public void storeIfNeeded()
  674. {
  675. if (this._dirty)
  676. storeConfig();
  677. }
  678. public void refreshIfNeeded()
  679. {
  680. if ((!this._dirty) && (isDiskNewer()))
  681. refreshProperties();
  682. }
  683. public void storeInstalledJREs(Vector paramVector)
  684. {
  685. this._dirty |= JREInfo.setInstalledJREList(paramVector);
  686. storeIfNeeded();
  687. }
  688. public String getEnterpriseString()
  689. {
  690. return this._enterprizeConfig;
  691. }
  692. public boolean isValid()
  693. {
  694. return this._configOK;
  695. }
  696. public boolean isConfigDirty()
  697. {
  698. return this._dirty;
  699. }
  700. public Properties getSystemProps()
  701. {
  702. return this._systemProps;
  703. }
  704. }
  705. /* Location: /opt/sun/java32/jdk1.7.0_04/jre/lib/deploy.jar
  706. * Qualified Name: com.sun.deploy.config.ClientConfig
  707. * JD-Core Version: 0.6.0
  708. */