StreamResource
@Response @Deprecated public class StreamResource extends Object implements Streamable
Constructor and Description |
---|
StreamResource(MediaType mediaType,
Map<String,Object> headers,
Object... contents)
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static StreamResourceBuilder |
create()
Deprecated.
Creates a new instance of a
StreamResourceBuilder |
Map<String,Object> |
getHeaders()
Deprecated.
Get the HTTP response headers.
|
MediaType |
getMediaType()
Deprecated.
Returns the serialized media type for this resource (e.g.
|
void |
streamTo(OutputStream os)
Deprecated.
Serialize this object to the specified output stream.
|
public StreamResource(MediaType mediaType, Map<String,Object> headers, Object... contents) throws IOException
mediaType
- The resource media type.headers
- The HTTP response headers for this streamed resource.contents
- The resource contents.
byte []
InputStream
Reader
- Converted to UTF-8 bytes.
File
CharSequence
- Converted to UTF-8 bytes.
IOException
public static StreamResourceBuilder create()
StreamResourceBuilder
StreamResourceBuilder
@ResponseHeader(value="*") public Map<String,Object> getHeaders()
@ResponseBody public void streamTo(OutputStream os) throws IOException
Streamable
streamTo
in interface Streamable
os
- The output stream to stream to.IOException
@ResponseHeader(value="Content-Type") public MediaType getMediaType()
Streamable
getMediaType
in interface Streamable
Copyright © 2018 Apache. All rights reserved.