Index: /trunk/icedtea-web/netx/net/sourceforge/jnlp/browser/FirefoxPreferencesFinder.java
===================================================================
--- /trunk/icedtea-web/netx/net/sourceforge/jnlp/browser/FirefoxPreferencesFinder.java	(revision 440)
+++ /trunk/icedtea-web/netx/net/sourceforge/jnlp/browser/FirefoxPreferencesFinder.java	(revision 441)
@@ -66,5 +66,5 @@
 
         String configPath = System.getProperty("user.home") + File.separator
-                + (Defaults.OS_DOS_LIKE ? "Mozilla" : ".mozilla")
+                + (JNLPRuntime.OS_DOS_LIKE ? "Mozilla" : ".mozilla")
                 + File.separator + "firefox" + File.separator;
 
Index: /trunk/icedtea-web/netx/net/sourceforge/jnlp/config/Defaults.java
===================================================================
--- /trunk/icedtea-web/netx/net/sourceforge/jnlp/config/Defaults.java	(revision 440)
+++ /trunk/icedtea-web/netx/net/sourceforge/jnlp/config/Defaults.java	(revision 441)
@@ -81,11 +81,4 @@
 
     /**
-     * Whether the OS is a DOS-like (Windows, OS/2) or not.
-     */
-    public static final boolean OS_DOS_LIKE =
-        System.getProperty("os.name").startsWith("OS/2") ||
-        System.getProperty("os.name").contains("Windows");
-
-    /**
      * Get the default settings for deployment
      */
Index: /trunk/icedtea-web/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java
===================================================================
--- /trunk/icedtea-web/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java	(revision 440)
+++ /trunk/icedtea-web/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java	(revision 441)
@@ -761,19 +761,30 @@
 
     /**
-     * @return {@code true} if running on Windows
-     */
-    public static boolean isWindows() {
+     * Set to {@code true} if running on Windows.
+     */
+    public static final boolean OS_WIN;
+
+    /**
+     * Set to {@code true} if running on OS/2.
+     */
+    public static final boolean OS_OS2;
+
+    static {
         String os = System.getProperty("os.name");
-        return (os != null && os.startsWith("Windows"));
-    }
-
-    /**
-     * @return {@code true} if running on a Unix or Unix-like system (including
-     * Linux and *BSD)
-     */
-    public static boolean isUnix() {
-        String sep = System.getProperty("file.separator");
-        return (sep != null && sep.equals("/"));
-    }
+        OS_WIN = os != null && System.getProperty("os.name").startsWith("Windows");
+        OS_OS2 = os != null && System.getProperty("os.name").startsWith("OS/2");
+    }
+
+    /**
+     * Set to {@code true} if running on Windows or OS/2.
+     */
+    public static final boolean OS_DOS_LIKE = OS_WIN || OS_OS2;
+
+    /**
+     * Set to {@code true} if running on Unix or Unix-like system (including
+     * Linux and *BSD). This is pretty much dumb ATM as it simply negates OS_DOS but it's not
+     * dumbier than the method used before (based on 'file.separator' equal to '/').
+     */
+    public static final boolean OS_UNIX_LIKE = !OS_DOS_LIKE;
 
     public static void setInitialArgments(List<String> args) {
Index: /trunk/icedtea-web/netx/net/sourceforge/jnlp/services/XBasicService.java
===================================================================
--- /trunk/icedtea-web/netx/net/sourceforge/jnlp/services/XBasicService.java	(revision 440)
+++ /trunk/icedtea-web/netx/net/sourceforge/jnlp/services/XBasicService.java	(revision 441)
@@ -201,7 +201,7 @@
      */
     private void initializeBrowserCommand() {
-        if (JNLPRuntime.isWindows()) {
+        if (JNLPRuntime.OS_WIN) {
             command = "rundll32 url.dll,FileProtocolHandler ";
-        } else if (JNLPRuntime.isUnix()) {
+        } else if (JNLPRuntime.OS_UNIX_LIKE) {
             DeploymentConfiguration config = JNLPRuntime.getConfiguration();
             command = config.getProperty(DeploymentConfiguration.KEY_BROWSER_PATH);
Index: /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/FileUtils.java
===================================================================
--- /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/FileUtils.java	(revision 440)
+++ /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/FileUtils.java	(revision 441)
@@ -217,5 +217,5 @@
         }
 
-        if (JNLPRuntime.isWindows()) {
+        if (JNLPRuntime.OS_DOS_LIKE) {
             // remove all permissions
             if (!tempFile.setExecutable(false, false)) {
@@ -243,4 +243,9 @@
                 OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RGetXPermFailed", tempFile));
             }
+
+            // On OS/2 and Windows, renameTo() fails if the target exists
+            // so delete it first
+            file.delete();
+
             // rename this file. Unless the file is moved/renamed, any program that
             // opened the file right after it was created might still be able to
@@ -250,6 +255,5 @@
             }
         } else {
-        // remove all permissions
-        if (!Defaults.OS_DOS_LIKE) {
+            // remove all permissions
             if (!tempFile.setExecutable(false, false)) {
                 throw new IOException(R("RRemoveXPermFailed", tempFile));
@@ -258,35 +262,29 @@
                 throw new IOException(R("RRemoveRPermFailed", tempFile));
             }
-        }
-        if (!tempFile.setWritable(false, false)) {
-            throw new IOException(R("RRemoveWPermFailed", tempFile));
-        }
-
-        // allow owner to read
-        if (!tempFile.setReadable(true, true)) {
-            throw new IOException(R("RGetRPermFailed", tempFile));
-        }
-
-        // allow owner to write
-        if (writableByOwner && !tempFile.setWritable(true, true)) {
-            throw new IOException(R("RGetWPermFailed", tempFile));
-        }
-
-        // allow owner to enter directories
-        if (isDir && !tempFile.setExecutable(true, true)) {
-            throw new IOException(R("RGetXPermFailed", tempFile));
-        }
-        
-        // rename this file. Unless the file is moved/renamed, any program that
-        // opened the file right after it was created might still be able to
-        // read the data.
-        if (Defaults.OS_DOS_LIKE) {
-            // On OS/2 and Windows, renameTo() fails if the target exists
-            // so delete it first
-            file.delete();
-        }
-        if (!tempFile.renameTo(file)) {
-            throw new IOException(R("RCantRename", tempFile, file));
-        }
+            if (!tempFile.setWritable(false, false)) {
+                throw new IOException(R("RRemoveWPermFailed", tempFile));
+            }
+
+            // allow owner to read
+            if (!tempFile.setReadable(true, true)) {
+                throw new IOException(R("RGetRPermFailed", tempFile));
+            }
+
+            // allow owner to write
+            if (writableByOwner && !tempFile.setWritable(true, true)) {
+                throw new IOException(R("RGetWPermFailed", tempFile));
+            }
+
+            // allow owner to enter directories
+            if (isDir && !tempFile.setExecutable(true, true)) {
+                throw new IOException(R("RGetXPermFailed", tempFile));
+            }
+
+            // rename this file. Unless the file is moved/renamed, any program that
+            // opened the file right after it was created might still be able to
+            // read the data.
+            if (!tempFile.renameTo(file)) {
+                throw new IOException(R("RCantRename", tempFile, file));
+            }
         }
 
@@ -510,5 +508,5 @@
     public static FileLock getFileLock(String path, boolean shared, boolean allowBlock) throws FileNotFoundException {
         // @todo temporary solution, see http://svn.netlabs.org/java/ticket/169
-        if (Defaults.OS_DOS_LIKE)
+        if (JNLPRuntime.OS_DOS_LIKE)
             return null;
         RandomAccessFile rafFile = new RandomAccessFile(path, "rw");
Index: /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java
===================================================================
--- /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java	(revision 440)
+++ /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java	(revision 441)
@@ -114,5 +114,6 @@
      */
     public void lock() throws IOException {
-        if (JNLPRuntime.isWindows()) {
+        // @todo temporary solution, see http://svn.netlabs.org/java/ticket/169
+        if (JNLPRuntime.OS_DOS_LIKE) {
             return;
         }
@@ -141,5 +142,6 @@
      */
     public void unlock() throws IOException {
-        if (JNLPRuntime.isWindows()) {
+        // @todo temporary solution, see http://svn.netlabs.org/java/ticket/169
+        if (JNLPRuntime.OS_DOS_LIKE) {
             return;
         }
Index: /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/logging/OutputController.java
===================================================================
--- /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/logging/OutputController.java	(revision 440)
+++ /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/logging/OutputController.java	(revision 441)
@@ -347,5 +347,5 @@
 
         private static SingleStreamLogger initSystemLogger() {
-            if (JNLPRuntime.isWindows()) {
+            if (JNLPRuntime.OS_WIN) {
                 return new WinSystemLog();
             } else {
