diff options
author | Omair Majid <[email protected]> | 2010-11-03 11:33:41 -0400 |
---|---|---|
committer | Omair Majid <[email protected]> | 2010-11-03 11:33:41 -0400 |
commit | 906dabe74dac87a2495fdede424a40035bfaba66 (patch) | |
tree | 4643ac6261493fe8aa33d0a2873835689ec5d9c3 /netx/net/sourceforge/jnlp/util | |
parent | 5fc98068846ee4772b93d49a44b0f13b37f0baf1 (diff) |
use deployment.properties file for infrastructure related configuration
2010-11-03 Omair Majid <[email protected]>
* netx/net/sourceforge/jnlp/Launcher.java
(markNetxRunning): Get file name from configuration.
(markNetxStopped): Likewise.
* netx/net/sourceforge/jnlp/cache/CacheUtil.java
(clearCache): Get cache directory from configuration.
(okToClearCache): Get netx_running file from configuration.
(getCacheFile): Get cache directory from configuration.
(urlToPath): Change semantics to take in the full path of the
directory instead of a directory under runtime.
* netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java:
Change DEPLOYMENT_DIR to ".icedtea". Add constants
KEY_USER_CACHE_DIR, KEY_USER_PERSISTENCE_CACHE_DIR,
KEY_SYSTEM_CACHE_DIR, KEY_USER_LOG_DIR, KEY_USER_TMP_DIR,
KEY_USER_LOCKS_DIR, and KEY_USER_NETX_RUNNING_FILE.
(load): Use DEPLOYMENT_DIR instead of hardcoded string.
(loadDefaultProperties): Add LOCKS_DIR. Replace strings with
constants. Add new default values for persistence cache directory,
single instance locks directory and the netx_running file.
* netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Remove
unneeded TMP_DIR, LOCKS_DIR and NETX_RUNNING_FILE
* netx/net/sourceforge/jnlp/services/SingleInstanceLock.java
(getLockFile): Get locks directory from configuration.
* netx/net/sourceforge/jnlp/services/XPersistenceService.java
(toCacheFile): Get persistence cache directory from configuration.
* netx/net/sourceforge/jnlp/util/XDesktopEntry.java
(getContentsAsReader): Get cache directory from configuration.
(installDesktopLauncher): Get temporary directory from
configuration. Make parent directories if required.
* plugin/icedteanp/java/sun/applet/JavaConsole.java
(initialize): Get log directory from configuration and create the
error and output files under it.
* plugin/icedteanp/java/sun/applet/PluginMain.java:
PLUGIN_STDERR_FILE and PLUGIN_STDOUT_FILE are now just filesnames.
(PluginMain): Use configuration for finding the log directory.
Initialize JNLPRuntime before creating the stderr and stdout logs.
Diffstat (limited to 'netx/net/sourceforge/jnlp/util')
-rw-r--r-- | netx/net/sourceforge/jnlp/util/XDesktopEntry.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java index 8527fed..5bed221 100644 --- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java +++ b/netx/net/sourceforge/jnlp/util/XDesktopEntry.java @@ -32,6 +32,7 @@ import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.StreamEater; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.UpdatePolicy; +import net.sourceforge.jnlp.runtime.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; /** @@ -73,7 +74,9 @@ public class XDesktopEntry { String pathToJavaws = System.getProperty("java.home") + File.separator + "bin" + File.separator + "javaws"; - File cacheFile = CacheUtil.urlToPath(file.getSourceLocation(), "cache"); + String cacheDir = JNLPRuntime.getConfiguration() + .getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR); + File cacheFile = CacheUtil.urlToPath(file.getSourceLocation(), cacheDir); String fileContents = "[Desktop Entry]\n"; fileContents += "Version=1.0\n"; @@ -131,10 +134,14 @@ public class XDesktopEntry { * Install this XDesktopEntry into the user's desktop as a launcher */ private void installDesktopLauncher() { - File shortcutFile = new File(JNLPRuntime.TMP_DIR + File.separator - + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop"); + File shortcutFile = new File(JNLPRuntime.getConfiguration() + .getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR) + + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop"); try { + if (!shortcutFile.getParentFile().isDirectory() && !shortcutFile.getParentFile().mkdirs()) { + throw new IOException(shortcutFile.getParentFile().toString()); + } /* * Write out a Java String (UTF-16) as a UTF-8 file */ |