You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by km...@apache.org on 2013/11/22 15:32:45 UTC
git commit: KNOX-203: Gateway fails to start when bin dir not writable
Updated Branches:
refs/heads/master e26b7c111 -> 7dec7eb44
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/7dec7eb4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-knox/tree/7dec7eb4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-knox/diff/7dec7eb4
Branch: refs/heads/master
Commit: 7dec7eb44e88ab322c91bb25be746f03835a7efb
Parents: e26b7c1
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Fri Nov 22 09:32:38 2013 -0500
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Fri Nov 22 09:32:38 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/7dec7eb4/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.
}
}