diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java @@ -89,6 +89,7 @@ import net.sourceforge.jnlp.security.Plu import net.sourceforge.jnlp.security.SecurityDialogs; import net.sourceforge.jnlp.tools.JarCertVerifier; import net.sourceforge.jnlp.util.FileUtils; +import net.sourceforge.jnlp.util.StreamUtils; import sun.misc.JarIndex; /** @@ -1022,30 +1023,16 @@ public class JNLPClassLoader extends URL } finally { //Close all streams - closeStream(inStream); - closeStream(inputReader); - closeStream(fr); - closeStream(jnlpReader); + StreamUtils.closeSilently(inStream); + StreamUtils.closeSilently(inputReader); + StreamUtils.closeSilently(fr); + StreamUtils.closeSilently(jnlpReader); } if (JNLPRuntime.isDebug()) System.err.println("Ending check for signed JNLP file..."); } - /*** - * Closes a stream - * - * @param stream the stream that will be closed - */ - private void closeStream (Closeable stream) { - if (stream != null) - try { - stream.close(); - } catch (Exception e) { - e.printStackTrace(System.err); - } - } - /** * Prompt the user for trust on all the signers that require approval. * @throws LaunchException if the user does not approve every dialog prompt. diff --git a/netx/net/sourceforge/jnlp/util/StreamUtils.java b/netx/net/sourceforge/jnlp/util/StreamUtils.java --- a/netx/net/sourceforge/jnlp/util/StreamUtils.java +++ b/netx/net/sourceforge/jnlp/util/StreamUtils.java @@ -37,6 +37,7 @@ exception statement from your version. package net.sourceforge.jnlp.util; +import java.io.Closeable; import java.io.IOException; import java.io.InputStream; @@ -55,4 +56,17 @@ public class StreamUtils { in.close(); } + /*** + * Closes a stream, without throwing an exception + * + * @param stream the stream that will be closed + */ + public static void closeSilently (Closeable stream) { + if (stream != null) + try { + stream.close(); + } catch (Exception e) { + e.printStackTrace(System.err); + } + } } \ No newline at end of file