DataRecordDownloadOptions { @Nullable public String getContentTypeHeader() { if (Strings.isNullOrEmpty(contentTypeHeader)) { if (!Strings.isNullOrEmpty(mediaType)) { contentTypeHeader = Strings.isNullOrEmpty(characterEncoding) ? mediaType : Joiner.on("; charset=").join(mediaType, characterEncoding); } } return contentTypeHeader; } private  DataRecordDownloadOptions(final String mediaType,
                                      final String characterEncoding,
                                      final String fileName,
                                      final String dispositionType,
                                      boolean domainOverrideIgnored); static DataRecordDownloadOptions fromBlobDownloadOptions(
            @NotNull BlobDownloadOptions downloadOptions); @Nullable String getContentTypeHeader(); @Nullable String getContentDispositionHeader(); @Nullable String getMediaType(); @Nullable String getCharacterEncoding(); @Nullable String getFileName(); @Nullable String getDispositionType(); boolean isDomainOverrideIgnored(); static DataRecordDownloadOptions DEFAULT; }
@Test public void testGetContentTypeHeader() { for (String mediaType : Lists.newArrayList(MEDIA_TYPE_TEXT_PLAIN, MEDIA_TYPE_IMAGE_PNG)) { for (String characterEncoding : Lists.newArrayList(CHARACTER_ENCODING_UTF_8, CHARACTER_ENCODING_ISO_8859_1)) { verifyContentTypeHeader( getOptions(mediaType, characterEncoding, null, null), getContentTypeHeader(mediaType, characterEncoding) ); } } }