@NonNull
    public static File buildFile(final File base, @NonNull final String fileName, final boolean isUrl, final boolean createDirs) {
        if (createDirs) {
            mkdirs(base);
        }
        return new File(base, isUrl ? CryptUtils.md5(fileName) + getExtension(fileName) : fileName);
    }
Save a stream to a file.
<p/>
If the response could not be saved to the file due, for example, to a network error, the file will not exist when
this method returns.

@param inputStream the stream whose content will be saved
@param targetFile  the target file, which will be created if necessary
@return true if the operation was successful, false otherwise
main/src/main/java/cgeo/geocaching/utils/FileUtils.java