ReaderResource
@Response @Deprecated public class ReaderResource extends Object implements Writable
Constructor and Description |
---|
ReaderResource(MediaType mediaType,
Map<String,Object> headers,
VarResolverSession varSession,
Object... contents)
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static ReaderResourceBuilder |
create()
Deprecated.
Creates a new instance of a
ReaderResourceBuilder |
Map<String,Object> |
getHeaders()
Deprecated.
Get the HTTP response headers.
|
MediaType |
getMediaType()
Deprecated.
Returns the serialized media type for this resource (e.g.
|
String |
toCommentStrippedString()
Deprecated.
Same as
toString() but strips comments from the text before returning it. |
String |
toString()
Deprecated.
|
Writer |
writeTo(Writer w)
Deprecated.
Serialize this object to the specified writer.
|
public ReaderResource(MediaType mediaType, Map<String,Object> headers, VarResolverSession varSession, Object... contents) throws IOException
mediaType
- The resource media type.headers
- The HTTP response headers for this streamed resource.varSession
- Optional variable resolver for resolving variables in the string.contents
- The resource contents.
InputStream
Reader
- Converted to UTF-8 bytes.
File
CharSequence
- Converted to UTF-8 bytes.
IOException
public static ReaderResourceBuilder create()
ReaderResourceBuilder
ReaderResourceBuilder
@ResponseHeader(value="*") public Map<String,Object> getHeaders()
@ResponseBody public Writer writeTo(Writer w) throws IOException
Writable
writeTo
in interface Writable
w
- The writer to write to.IOException
@ResponseHeader(value="Content-Type") public MediaType getMediaType()
Writable
getMediaType
in interface Writable
public String toCommentStrippedString()
toString()
but strips comments from the text before returning it.
Supports stripping comments from the following media types: HTML, XHTML, XML, JSON, Javascript, CSS.
Copyright © 2018 Apache. All rights reserved.