public static boolean saveEntityToFile(@NonNull final Response response, @NonNull final File targetFile) {
        try {
            final boolean saved = saveToFile(response.body().byteStream(), targetFile);
            if (saved) {
                saveHeader(HEADER_ETAG, response, targetFile);
                saveHeader(HEADER_LAST_MODIFIED, response, targetFile);
            }
            return saved;
        } catch (final Exception e) {
            Log.e("FileUtils.saveEntityToFile", e);
        }

        return false;
    }
Save an HTTP response to a file.

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