private static void saveHeader(final String name, @NonNull final Response response, @NonNull final File baseFile) {
        final String header = response.header(name);
        final File file = filenameForHeader(baseFile, name);
        if (header == null) {
            deleteIgnoringFailure(file);
        } else {
            saveToFile(new ByteArrayInputStream(header.getBytes(StandardCharsets.UTF_8)), file);
        }
    }
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