Java Code Examples for org.restlet.data.MediaType#TEXT_PLAIN

The following examples show how to use org.restlet.data.MediaType#TEXT_PLAIN . 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: IndexResource.java    From attic-polygene-java with Apache License 2.0 6 votes vote down vote up
@Override
public Representation get( Variant variant )
    throws ResourceException
{
    if( variant.getMediaType().equals( MediaType.APPLICATION_RDF_XML ) )
    {
        return new RdfXmlOutputRepresentation();
    }
    else if( variant.getMediaType().equals( MediaType.APPLICATION_RDF_TRIG ) )
    {
        return new RdfTrigOutputRepresentation( MediaType.APPLICATION_RDF_TRIG );
    }
    else if( variant.getMediaType().equals( MediaType.TEXT_PLAIN ) )
    {
        return new RdfTrigOutputRepresentation( MediaType.TEXT_PLAIN );
    }

    return null;
}
 
Example 2
Source File: StringRepresentation.java    From DeviceConnect-Android with MIT License 2 votes vote down vote up
/**
 * Constructor. The following metadata are used by default: "text/plain"
 * media type, no language and the UTF-8 character set.
 * 
 * @param chars
 *            The characters array.
 */
public StringRepresentation(char[] chars) {
    this(new String(chars), MediaType.TEXT_PLAIN);
}
 
Example 3
Source File: StringRepresentation.java    From DeviceConnect-Android with MIT License 2 votes vote down vote up
/**
 * Constructor. The following metadata are used by default: "text/plain"
 * media type, no language and the UTF-8 character set.
 * 
 * @param text
 *            The string value.
 */
public StringRepresentation(CharSequence text) {
    this(text, MediaType.TEXT_PLAIN);
}
 
Example 4
Source File: StringRepresentation.java    From DeviceConnect-Android with MIT License 2 votes vote down vote up
/**
 * Constructor. The following metadata are used by default: "text/plain"
 * media type, no language and the UTF-8 character set.
 * 
 * @param text
 *            The string value.
 * @param language
 *            The language.
 */
public StringRepresentation(CharSequence text, Language language) {
    this(text, MediaType.TEXT_PLAIN, language);
}