JWS-44 - attempt to make a file executable if it is supposed to be executable accordi...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Wed, 6 Jun 2012 18:02:52 +0000 (19:02 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Wed, 6 Jun 2012 18:03:37 +0000 (19:03 +0100)
engine/compbio/engine/client/PathValidator.java

index a10d82e..6c3996c 100644 (file)
@@ -33,7 +33,18 @@ public final class PathValidator {
                if (!exec.exists()) {\r
                        return false;\r
                }\r
-               return exec.canExecute();\r
+               if (!exec.canExecute()) {\r
+                       try {\r
+                               return exec.setExecutable(true);\r
+                       } catch (Exception x)\r
+                       {\r
+                               \r
+                       }catch (Error e)\r
+                       {\r
+                       }\r
+                       return false;\r
+               }\r
+               return true;\r
        }\r
 \r
        public static void validateExecutable(String command)\r