@Deprecated public final class StreamResourceBuilder extends Object
Constructor and Description |
---|
StreamResourceBuilder()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
StreamResource |
build()
Deprecated.
Create a new
StreamResource using values in this builder. |
StreamResourceBuilder |
contents(Object... contents)
Deprecated.
Specifies the contents for this resource.
|
StreamResourceBuilder |
header(String name,
Object value)
Deprecated.
Specifies an HTTP response header value.
|
StreamResourceBuilder |
headers(Map<String,Object> headers)
Deprecated.
Specifies HTTP response header values.
|
StreamResourceBuilder |
mediaType(MediaType mediaType)
Deprecated.
Specifies the resource media type string.
|
StreamResourceBuilder |
mediaType(String mediaType)
Deprecated.
Specifies the resource media type string.
|
public StreamResourceBuilder()
public StreamResourceBuilder mediaType(String mediaType)
mediaType
- The resource media type string.public StreamResourceBuilder mediaType(MediaType mediaType)
mediaType
- The resource media type string.public StreamResourceBuilder contents(Object... contents)
This method can be called multiple times to add more content.
contents
- The resource contents.
byte []
InputStream
Reader
- Converted to UTF-8 bytes.
File
CharSequence
- Converted to UTF-8 bytes.
public StreamResourceBuilder header(String name, Object value)
name
- The HTTP header name.value
- The HTTP header value.
String
using Object.toString()
.public StreamResourceBuilder headers(Map<String,Object> headers)
headers
- The HTTP headers.
Strings
using Object.toString()
.public StreamResource build() throws IOException
StreamResource
using values in this builder.StreamResource
object.IOException
Copyright © 2018 Apache. All rights reserved.