summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-05-08 01:45:44 (EDT)
committerEike Stepper2007-05-08 01:45:44 (EDT)
commit243265c8ea999d12b1c56f6fb358c6102060a3e4 (patch)
treecdecd3b5c08a3360f61a596dfb6345c8d42932c9
parent58ec4e0cfba8ec9535c5e0367d4c94bacd656999 (diff)
downloadcdo-243265c8ea999d12b1c56f6fb358c6102060a3e4.zip
cdo-243265c8ea999d12b1c56f6fb358c6102060a3e4.tar.gz
cdo-243265c8ea999d12b1c56f6fb358c6102060a3e4.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/IOUtil.java58
1 files changed, 4 insertions, 54 deletions
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/IOUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/IOUtil.java
index 7f7bf6b..696a551 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/IOUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/IOUtil.java
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.net4j.util;
+import java.io.Closeable;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
@@ -56,64 +57,13 @@ public final class IOUtil
print(t, ERR);
}
- public static Exception closeSilent(InputStream stream)
+ public static Exception closeSilent(Closeable closeable)
{
try
{
- if (stream != null)
+ if (closeable != null)
{
- stream.close();
- }
-
- return null;
- }
- catch (Exception ex)
- {
- return ex;
- }
- }
-
- public static Exception closeSilent(OutputStream stream)
- {
- try
- {
- if (stream != null)
- {
- stream.close();
- }
-
- return null;
- }
- catch (Exception ex)
- {
- return ex;
- }
- }
-
- public static Exception closeSilent(Reader reader)
- {
- try
- {
- if (reader != null)
- {
- reader.close();
- }
-
- return null;
- }
- catch (Exception ex)
- {
- return ex;
- }
- }
-
- public static Exception closeSilent(Writer writer)
- {
- try
- {
- if (writer != null)
- {
- writer.close();
+ closeable.close();
}
return null;