aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/utils/IOUtils.java
blob: 8e483d3411488018f2d9d6ba10f8a14105da43ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package cgeo.geocaching.utils;

import org.eclipse.jdt.annotation.Nullable;

import java.io.Closeable;
import java.io.IOException;

final public class IOUtils {

    private IOUtils() {
        // utility class
    }

    public static void closeQuietly(@Nullable final Closeable closeable) {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (final IOException e) {
                Log.w("closeQuietly: unable to close " + closeable, e);
            }
        }
    }

}