Examples of withCharset()


Examples of com.google.common.net.MediaType.withCharset()

        MediaType mediaType;
        try {
            mediaType = MediaType.parse(mimeType);

            if (mediaType.is(MediaType.ANY_TEXT_TYPE)) {
                mediaType = mediaType.withCharset(DEFAULT_CHARSET);
            }
        } catch (IllegalArgumentException e) {
            return DEFAULT_MEDIA_TYPE;
        }
View Full Code Here

Examples of com.google.common.net.MediaType.withCharset()

            if (mimeTypeOfExtension != null) {
                try {
                    mediaType = MediaType.parse(mimeTypeOfExtension);
                    if (defaultCharset != null && mediaType.is(MediaType.ANY_TEXT_TYPE)) {
                        mediaType = mediaType.withCharset(defaultCharset);
                    }
                } catch (IllegalArgumentException ignore) {}
            }

            resp.setContentType(mediaType.type() + '/' + mediaType.subtype());
View Full Code Here

Examples of com.google.common.net.MediaType.withCharset()

            if (mimeType != null) {
                try {
                    mediaType = MediaType.parse(mimeType.toString());
                    if (defaultCharset != null && mediaType.is(MediaType.ANY_TEXT_TYPE)) {
                        mediaType = mediaType.withCharset(defaultCharset);
                    }
                } catch (IllegalArgumentException ignore) {}
            }

            resp.setContentType(mediaType.type() + "/" + mediaType.subtype());
View Full Code Here

Examples of com.google.common.net.MediaType.withCharset()

        MediaType mediaType;
        try {
            mediaType = MediaType.parse(mimeType.toString());

            if (mediaType.is(MediaType.ANY_TEXT_TYPE)) {
                mediaType = mediaType.withCharset(DEFAULT_CHARSET);
            }
        } catch (IllegalArgumentException e) {
            return DEFAULT_MEDIA_TYPE;
        }
View Full Code Here

Examples of com.google.common.net.MediaType.withCharset()

            if (mimeType != null) {
                try {
                    mediaType = MediaType.parse(mimeType.toString());
                    if (defaultCharset != null && mediaType.is(MediaType.ANY_TEXT_TYPE)) {
                        mediaType = mediaType.withCharset(defaultCharset);
                    }
                } catch (IllegalArgumentException ignore) {}
            }

            resp.setContentType(mediaType.type() + "/" + mediaType.subtype());
View Full Code Here

Examples of com.google.common.net.MediaType.withCharset()

            if (mimeType != null) {
                try {
                    mediaType = MediaType.parse(mimeType);
                    if (defaultCharset != null && mediaType.is(MediaType.ANY_TEXT_TYPE)) {
                        mediaType = mediaType.withCharset(defaultCharset);
                    }
                } catch (IllegalArgumentException ignore) {}
            }

            resp.setContentType(mediaType.type() + "/" + mediaType.subtype());
View Full Code Here

Examples of org.apache.tapestry5.ContentType.withCharset()

        if (contentType.getBaseType().equals("text")
                && ! contentType.hasParameters()
                && processing != StreamableResourceProcessing.FOR_AGGREGATION)
        {
            return resource.withContentType(contentType.withCharset("utf-8"));
        }

        return resource;
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.