From dec45bbdb6a28b6c28c371982e5d4737a008f4a0 Mon Sep 17 00:00:00 2001
From: abobrov <abobrov@localhost>
Date: Sat, 22 Dec 2007 23:07:20 +0000
Subject: [PATCH] - fix permissions for Java Application Stubs used in MacOS X app bundles so that they are usable from within WebStart installation.

---
 opends/src/quicksetup/org/opends/quicksetup/util/Utils.java   |   23 +++++++++--------------
 opends/src/quicksetup/org/opends/quicksetup/Installation.java |    5 +++++
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/Installation.java b/opends/src/quicksetup/org/opends/quicksetup/Installation.java
index 9b3e1c1..5f90141 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/Installation.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/Installation.java
@@ -213,6 +213,11 @@
   public static final String WINDOWS_STATUSPANEL_FILE_NAME = "status-panel.bat";
 
   /**
+   * The MacOS X Java application stub name.
+   */
+  public static final String MAC_JAVA_APP_STUB_NAME = "JavaApplicationStub";
+
+  /**
    * The MacOS X status panel application bundle name.
    */
   public static final String MAC_STATUSPANEL_FILE_NAME = "StatusPanel.app";
diff --git a/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java b/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
index 63efce0..5a96c05 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -1218,33 +1218,28 @@
    * @return the file system permissions for the file.
    */
   static public String getFileSystemPermissions(File file)
-    {
+  {
     String perm;
     String name = file.getName();
     if (file.getParent().endsWith(
         File.separator + Installation.WINDOWS_BINARIES_PATH_RELATIVE) ||
         file.getParent().endsWith(
-        File.separator + Installation.UNIX_BINARIES_PATH_RELATIVE))
-    {
-      if (name.endsWith(".bat"))
-      {
+        File.separator + Installation.UNIX_BINARIES_PATH_RELATIVE)) {
+      if (name.endsWith(".bat")) {
         perm = "644";
       }
-      else
-      {
+      else {
         perm = "755";
       }
-    }
-    else if (name.endsWith(".sh"))
-    {
+    } else if (name.endsWith(".sh")) {
       perm = "755";
     } else if (name.endsWith(Installation.UNIX_SETUP_FILE_NAME) ||
             name.endsWith(Installation.UNIX_UNINSTALL_FILE_NAME) ||
-            name.endsWith(Installation.UNIX_UPGRADE_FILE_NAME))
-    {
+            name.endsWith(Installation.UNIX_UPGRADE_FILE_NAME)) {
       perm = "755";
-    } else
-    {
+    } else if (name.endsWith(Installation.MAC_JAVA_APP_STUB_NAME)) {
+      perm = "755";
+    } else {
       perm = "644";
     }
     return perm;

--
Gitblit v1.10.0