diff options
Diffstat (limited to 'main/src/cgeo/geocaching/utils/IOUtils.java')
| -rw-r--r-- | main/src/cgeo/geocaching/utils/IOUtils.java | 22 |
1 files changed, 22 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..df90da3 --- /dev/null +++ b/main/src/cgeo/geocaching/utils/IOUtils.java @@ -0,0 +1,22 @@ +package cgeo.geocaching.utils; + +import java.io.Closeable; +import java.io.IOException; + +final public class IOUtils { + + private IOUtils() { + // utility class + } + + 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); + } + } + } + +} |
