@Nullable
    public static File getOrCreate(@NonNull final File dir, @Nullable final String prefix, @Nullable final String suffix, @Nullable final byte[] data) {
        if (data == null) {
            return null;
        }
        mkdirs(dir);
        final File file = new File(dir, createFilenameFor(prefix, suffix, data));
        if (!file.isFile()) {
            try {
                org.apache.commons.io.FileUtils.writeByteArrayToFile(file, data);
            } catch (Exception e) {
                Log.e("Problem extracting/storing data (prefix='" + prefix + "', dir = '" + dir + "'", e);
                return null;
            }
        }
        return file;
    }
Returns the available space in bytes on the mount point used by the given dir.
main/src/main/java/cgeo/geocaching/utils/FileUtils.java