Java Code Examples for org.springframework.http.MediaType#TEXT_XML

The following examples show how to use org.springframework.http.MediaType#TEXT_XML . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AttachmentApiController.java    From onboard with Apache License 2.0 7 votes vote down vote up
private MediaType getContentType(String contentType) {
    if (contentType.equalsIgnoreCase(MediaType.IMAGE_GIF_VALUE)) {
        return MediaType.IMAGE_GIF;
    } else if (contentType.equalsIgnoreCase(MediaType.IMAGE_PNG_VALUE)) {
        return MediaType.IMAGE_PNG;
    } else if (contentType.equalsIgnoreCase(MediaType.IMAGE_JPEG_VALUE)) {
        return MediaType.IMAGE_JPEG;
    } else if (contentType.equalsIgnoreCase(MediaType.TEXT_PLAIN_VALUE)) {
        return MediaType.TEXT_PLAIN;
    } else if (contentType.equalsIgnoreCase(MediaType.TEXT_XML_VALUE)) {
        return MediaType.TEXT_XML;
    } else if (contentType.equalsIgnoreCase(MediaType.TEXT_HTML_VALUE)) {
        return MediaType.TEXT_HTML;
    }
    return MediaType.APPLICATION_OCTET_STREAM;
}
 
Example 2
Source File: AttachmentApi.java    From onboard with Apache License 2.0 6 votes vote down vote up
private MediaType getContentType(String contentType) {
    if (contentType.equalsIgnoreCase(MediaType.IMAGE_GIF_VALUE)) {
        return MediaType.IMAGE_GIF;
    } else if (contentType.equalsIgnoreCase(MediaType.IMAGE_PNG_VALUE)) {
        return MediaType.IMAGE_PNG;
    } else if (contentType.equalsIgnoreCase(MediaType.IMAGE_JPEG_VALUE)) {
        return MediaType.IMAGE_JPEG;
    } else if (contentType.equalsIgnoreCase(MediaType.TEXT_PLAIN_VALUE)) {
        return MediaType.TEXT_PLAIN;
    } else if (contentType.equalsIgnoreCase(MediaType.TEXT_XML_VALUE)) {
        return MediaType.TEXT_XML;
    } else if (contentType.equalsIgnoreCase(MediaType.TEXT_HTML_VALUE)) {
        return MediaType.TEXT_HTML;
    }
    return MediaType.APPLICATION_OCTET_STREAM;
}
 
Example 3
Source File: AbstractXmlHttpMessageConverter.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Protected constructor that sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
protected AbstractXmlHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
Example 4
Source File: SourceHttpMessageConverter.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
public SourceHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
Example 5
Source File: AbstractXmlHttpMessageConverter.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Protected constructor that sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
protected AbstractXmlHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
Example 6
Source File: SourceHttpMessageConverter.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
public SourceHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
Example 7
Source File: AbstractXmlHttpMessageConverter.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Protected constructor that sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
protected AbstractXmlHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
Example 8
Source File: SourceHttpMessageConverter.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
public SourceHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
Example 9
Source File: AbstractXmlHttpMessageConverter.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Protected constructor that sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
protected AbstractXmlHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}
 
Example 10
Source File: SourceHttpMessageConverter.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the {@link #setSupportedMediaTypes(java.util.List) supportedMediaTypes}
 * to {@code text/xml} and {@code application/xml}, and {@code application/*-xml}.
 */
public SourceHttpMessageConverter() {
	super(MediaType.APPLICATION_XML, MediaType.TEXT_XML, new MediaType("application", "*+xml"));
}