knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmc...@apache.org
Subject [1/3] git commit: KNOX-203: Gateway fails to start when bin dir not writable
Date Fri, 06 Dec 2013 15:59:51 GMT
Updated Branches:
  refs/heads/v0.3.1 02de35e5e -> ff0a9812f


KNOX-203: Gateway fails to start when bin dir not writable


Project: http://git-wip-us.apache.org/repos/asf/incubator-knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-knox/commit/fac427da
Tree: http://git-wip-us.apache.org/repos/asf/incubator-knox/tree/fac427da
Diff: http://git-wip-us.apache.org/repos/asf/incubator-knox/diff/fac427da

Branch: refs/heads/v0.3.1
Commit: fac427da023f0791131f80f834db780bf060ca5a
Parents: 02de35e
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Fri Nov 22 09:32:38 2013 -0500
Committer: Larry McCay <lmccay@hortonworks.com>
Committed: Fri Dec 6 10:51:48 2013 -0500

----------------------------------------------------------------------
 .../apache/hadoop/gateway/launcher/Launcher.java    | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/fac427da/gateway-util-launcher/src/main/java/org/apache/hadoop/gateway/launcher/Launcher.java
----------------------------------------------------------------------
diff --git a/gateway-util-launcher/src/main/java/org/apache/hadoop/gateway/launcher/Launcher.java
b/gateway-util-launcher/src/main/java/org/apache/hadoop/gateway/launcher/Launcher.java
index 5f21ccd..d998ce6 100644
--- a/gateway-util-launcher/src/main/java/org/apache/hadoop/gateway/launcher/Launcher.java
+++ b/gateway-util-launcher/src/main/java/org/apache/hadoop/gateway/launcher/Launcher.java
@@ -121,13 +121,17 @@ public class Launcher {
   }
 
   private static void createExternalConfig( File file, Properties config, URL src ) throws
IOException {
-    if( file.createNewFile() ){
-      OutputStream output = new FileOutputStream( file );
-      try {
-        config.store( output, "Created from " + src );
-      } finally {
-        output.close();
+    try {
+      if( file.createNewFile() ){
+        OutputStream output = new FileOutputStream( file );
+        try {
+          config.store( output, "Created from " + src );
+        } finally {
+          output.close();
+        }
       }
+    } catch ( IOException e ) {
+      // Ignore it and use the embedded config.
     }
   }
 


Mime
View raw message