private static String createFilenameFor(@Nullable final String prefix, @Nullable final String suffix, @Nullable final byte[] data) {
        final StringBuilder sb = new StringBuilder();
        if (data == null) {
            sb.append("null");
        } else if (data.length == 0 || data.length == 1) {
            sb.append(data.length == 0 ? "empty" : data[0]);
        } else {
            sb.append(data.length).append("_").append(Arrays.hashCode(data))
                .append("_").append(data[1]).append("_").append(data[data.length - 2]);
        }
        return (StringUtils.isBlank(prefix) ? "" : replaceNonFilenameChars(prefix) + "_") + sb + (StringUtils.isBlank(suffix) ? "" : "." + replaceNonFilenameChars(suffix));
    }
Returns the available space in bytes on the mount point used by the given dir.
main/src/main/java/cgeo/geocaching/utils/FileUtils.java