You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by mj...@apache.org on 2017/10/27 17:52:01 UTC

[23/25] incubator-guacamole-client git commit: GUACAMOLE-362: Remove unnecessary IOException catch.

GUACAMOLE-362: Remove unnecessary IOException catch.


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

Branch: refs/heads/master
Commit: ad8820cf054721eda95d72fc06a42356501c6ca2
Parents: b968e07
Author: Nick Couchman <vn...@apache.org>
Authored: Fri Oct 27 13:45:25 2017 -0400
Committer: Nick Couchman <vn...@apache.org>
Committed: Fri Oct 27 13:45:25 2017 -0400

----------------------------------------------------------------------
 .../auth/cas/conf/PrivateKeyGuacamoleProperty.java        | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/ad8820cf/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/conf/PrivateKeyGuacamoleProperty.java
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/conf/PrivateKeyGuacamoleProperty.java b/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/conf/PrivateKeyGuacamoleProperty.java
index caa84cc..bd0bd69 100644
--- a/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/conf/PrivateKeyGuacamoleProperty.java
+++ b/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/conf/PrivateKeyGuacamoleProperty.java
@@ -56,13 +56,9 @@ public abstract class PrivateKeyGuacamoleProperty implements GuacamoleProperty<P
             FileInputStream keyStreamIn = new FileInputStream(keyFile);
             ByteArrayOutputStream keyStreamOut = new ByteArrayOutputStream();
             byte[] keyBuffer = new byte[1024];
-            try {
-                for (int readBytes; (readBytes = keyStreamIn.read(keyBuffer)) != -1;)
-                    keyStreamOut.write(keyBuffer, 0, readBytes);
-            }
-            catch (IOException e) {
-                throw new GuacamoleServerException("IOException while trying to read bytes from file.", e);
-            }
+
+            for (int readBytes; (readBytes = keyStreamIn.read(keyBuffer)) != -1;)
+                keyStreamOut.write(keyBuffer, 0, readBytes);
 
             final byte[] keyBytes = keyStreamOut.toByteArray();