Test commit, minor refactoring
This commit is contained in:
1 parent
4304c8c455
commit
09e0aaf335
1 file changed
+4
-34
+4
-34
@@ -1,10 +1,7 @@
|
||||
package net.sourceforge.pmd.eclipse.util;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -14,39 +11,12 @@ public class IOUtil {
|
||||
|
||||
private IOUtil() {}
|
||||
|
||||
public static void closeQuietly(OutputStream stream) {
|
||||
if (stream == null) return;
|
||||
public static void closeQuietly(Closeable closeable) {
|
||||
if (closeable == null) return;
|
||||
try {
|
||||
stream.close();
|
||||
closeable.close();
|
||||
} catch (IOException ex) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
public static void closeQuietly(InputStream stream) {
|
||||
if (stream == null) return;
|
||||
try {
|
||||
stream.close();
|
||||
} catch (IOException ex) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
public static void closeQuietly(Writer writer) {
|
||||
if (writer == null) return;
|
||||
try {
|
||||
writer.close();
|
||||
} catch (IOException ex) {
|
||||
// ignore it
|
||||
}
|
||||
}
|
||||
|
||||
public static void closeQuietly(Reader reader) {
|
||||
if (reader == null) return;
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException ex) {
|
||||
//ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user