aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/Launcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'netx/net/sourceforge/jnlp/Launcher.java')
-rw-r--r--netx/net/sourceforge/jnlp/Launcher.java14
1 files changed, 4 insertions, 10 deletions
diff --git a/netx/net/sourceforge/jnlp/Launcher.java b/netx/net/sourceforge/jnlp/Launcher.java
index a69400c..13e0f52 100644
--- a/netx/net/sourceforge/jnlp/Launcher.java
+++ b/netx/net/sourceforge/jnlp/Launcher.java
@@ -48,6 +48,7 @@ import net.sourceforge.jnlp.runtime.JNLPClassLoader;
import net.sourceforge.jnlp.runtime.JNLPRuntime;
import net.sourceforge.jnlp.services.InstanceExistsException;
import net.sourceforge.jnlp.services.ServiceUtil;
+import net.sourceforge.jnlp.util.FileUtils;
import net.sourceforge.jnlp.util.Reflect;
import javax.swing.SwingUtilities;
@@ -727,8 +728,9 @@ public class Launcher {
File netxRunningFile = new File(JNLPRuntime.getConfiguration()
.getProperty(DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE));
- netxRunningFile.getParentFile().mkdirs();
- if (netxRunningFile.createNewFile()) {
+ if (!netxRunningFile.exists()) {
+ netxRunningFile.getParentFile().mkdirs();
+ FileUtils.createRestrictedFile(netxRunningFile, true);
FileOutputStream fos = new FileOutputStream(netxRunningFile);
try {
fos.write(message.getBytes());
@@ -737,14 +739,6 @@ public class Launcher {
}
}
- if (!netxRunningFile.isFile()) {
- if (JNLPRuntime.isDebug()) {
- System.err.println("Unable to create instance file");
- }
- fileLock = null;
- return;
- }
-
FileInputStream is = new FileInputStream(netxRunningFile);
FileChannel channel = is.getChannel();
fileLock = channel.tryLock(0, Long.MAX_VALUE, true);