diff options
author | awnuk <awnuk@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2011-10-07 01:25:50 +0000 |
---|---|---|
committer | awnuk <awnuk@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2011-10-07 01:25:50 +0000 |
commit | 266e61562a2b7f2be88c000def6d8ad579159954 (patch) | |
tree | eb9c17a164cb2b386753515496c49ff2667132cd /pki | |
parent | 61bb84d63c5fd18ffe1d83fbcfd3f89dc39bae71 (diff) | |
download | pki-266e61562a2b7f2be88c000def6d8ad579159954.tar.gz pki-266e61562a2b7f2be88c000def6d8ad579159954.tar.xz pki-266e61562a2b7f2be88c000def6d8ad579159954.zip |
Fixed bugzilla bug #743770.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@2256 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki')
-rw-r--r-- | pki/base/silent/src/common/AutoInstaller.java | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/pki/base/silent/src/common/AutoInstaller.java b/pki/base/silent/src/common/AutoInstaller.java index fa2eabc53..3fb1c4a8b 100644 --- a/pki/base/silent/src/common/AutoInstaller.java +++ b/pki/base/silent/src/common/AutoInstaller.java @@ -90,9 +90,10 @@ public class AutoInstaller { // Create Password file private boolean CreatePasswordFile() { String s = "internal: " + SingleSignOnPWD; + OutputStream f0 = null; try { - OutputStream f0 = new FileOutputStream( + f0 = new FileOutputStream( serverRoot + "/" + instanceID + "/config/password.conf"); f0.write(s.getBytes()); @@ -100,14 +101,21 @@ public class AutoInstaller { return true; } catch (Exception e) { System.out.println("exception " + e.getMessage()); + try { + if (f0 != null) f0.close(); + } catch (IOException ioe) { + System.out.println("IO Exception: " + ioe.getMessage()); + } return false; } } private boolean BackupConfigFile() { + FileInputStream f1 = null; + OutputStream f2 = null; try { - FileInputStream f1 = new FileInputStream( + f1 = new FileInputStream( serverRoot + "/" + instanceID + "/config/CS.cfg"); int size = f1.available(); byte b[] = new byte[size]; @@ -115,7 +123,7 @@ public class AutoInstaller { if (f1.read(b) != b.length) { return false; } - OutputStream f2 = new FileOutputStream( + f2 = new FileOutputStream( serverRoot + "/" + instanceID + "/config/CS.cfg.org"); f2.write(b); @@ -125,6 +133,16 @@ public class AutoInstaller { return true; } catch (Exception e) { System.out.println("exception " + e.getMessage()); + try { + if (f1 != null) f1.close(); + } catch (IOException ioe) { + System.out.println("IO Exception: " + ioe.getMessage()); + } + try { + if (f2 != null) f2.close(); + } catch (IOException ioe) { + System.out.println("IO Exception: " + ioe.getMessage()); + } return false; } @@ -557,8 +575,9 @@ public class AutoInstaller { // //////////////////////////////////////////////////////// private void getProperties(String filePath) throws Exception { + FileInputStream fis = null; try { - FileInputStream fis = new FileInputStream(filePath); + fis = new FileInputStream(filePath); props = new Properties(); props.load(fis); @@ -566,7 +585,11 @@ public class AutoInstaller { } catch (Exception e) { System.out.println("exception " + e.getMessage()); } - + try { + if (fis != null) fis.close(); + } catch (IOException ioe) { + System.out.println("IO Exception: " + ioe.getMessage()); + } } private void setPropFile(String fileName) { |