aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/utils/IOUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/utils/IOUtils.java')
-rw-r--r--main/src/cgeo/geocaching/utils/IOUtils.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/utils/IOUtils.java b/main/src/cgeo/geocaching/utils/IOUtils.java
new file mode 100644
index 0000000..73db12f
--- /dev/null
+++ b/main/src/cgeo/geocaching/utils/IOUtils.java
@@ -0,0 +1,20 @@
+package cgeo.geocaching.utils;
+
+import java.io.Closeable;
+import java.io.IOException;
+
+final public class IOUtils {
+
+ private IOUtils() {}
+
+ public static void closeQuietly(final Closeable closeable) {
+ if (closeable != null) {
+ try {
+ closeable.close();
+ } catch (final IOException e) {
+ Log.w("closeQuietly: unable to close " + closeable, e);
+ }
+ }
+ }
+
+}