- java.lang.Object
-
- swim.http.HttpEntity<T>
-
- swim.http.HttpBody<T>
-
- All Implemented Interfaces:
Debug
public final class HttpBody<T> extends HttpEntity<T> implements Debug
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Encoder<?,?>content()static HttpBody<String>create(String content)static HttpBody<String>create(String content, MediaType mediaType)static <T> HttpBody<T>create(ByteBuffer data)static <T> HttpBody<T>create(ByteBuffer data, MediaType mediaType)static <T> HttpBody<T>create(Encoder<?,?> content, long length)static <T> HttpBody<T>create(Encoder<?,?> content, long length, MediaType mediaType)static <T> HttpBody<T>create(T value, Encoder<?,?> content, long length)static <T> HttpBody<T>create(T value, Encoder<?,?> content, long length, MediaType mediaType)<T> Output<T>debug(Output<T> output)Writes a developer readable, debug-formatted string representation of this object tooutput.static <T> Decoder<HttpMessage<T>>decodeHttp(HttpMessage<?> message, Decoder<T> content, long length, InputBuffer input)static <T> HttpBody<T>empty()<T2> Encoder<?,HttpMessage<T2>>encodeHttp(HttpMessage<T2> message, OutputBuffer<?> output, HttpWriter http)booleanequals(Object other)static <T> HttpBody<T>fromFile(String path)static <T> HttpBody<T>fromFile(String path, MediaType mediaType)static <T> HttpBody<T>fromResource(ClassLoader classLoader, String resource)static <T> HttpBody<T>fromResource(ClassLoader classLoader, String resource, MediaType mediaType)Tget()inthashCode()FingerTrieSeq<HttpHeader>headers()static <T> Decoder<HttpMessage<T>>httpDecoder(HttpMessage<?> message, Decoder<T> content, long length)<T2> Encoder<?,HttpMessage<T2>>httpEncoder(HttpMessage<T2> message, HttpWriter http)booleanisDefined()longlength()MediaTypemediaType()StringtoString()FingerTrieSeq<TransferCoding>transferCodings()-
Methods inherited from class swim.http.HttpEntity
encodeHttp, httpEncoder
-
-
-
-
Method Detail
-
isDefined
public boolean isDefined()
- Specified by:
isDefinedin classHttpEntity<T>
-
get
public T get()
- Specified by:
getin classHttpEntity<T>
-
content
public Encoder<?,?> content()
-
length
public long length()
- Specified by:
lengthin classHttpEntity<T>
-
mediaType
public MediaType mediaType()
- Specified by:
mediaTypein classHttpEntity<T>
-
transferCodings
public FingerTrieSeq<TransferCoding> transferCodings()
- Specified by:
transferCodingsin classHttpEntity<T>
-
headers
public FingerTrieSeq<HttpHeader> headers()
- Specified by:
headersin classHttpEntity<T>
-
httpEncoder
public <T2> Encoder<?,HttpMessage<T2>> httpEncoder(HttpMessage<T2> message, HttpWriter http)
- Specified by:
httpEncoderin classHttpEntity<T>
-
encodeHttp
public <T2> Encoder<?,HttpMessage<T2>> encodeHttp(HttpMessage<T2> message, OutputBuffer<?> output, HttpWriter http)
- Specified by:
encodeHttpin classHttpEntity<T>
-
debug
public <T> Output<T> debug(Output<T> output)
Description copied from interface:DebugWrites a developer readable, debug-formatted string representation of this object tooutput.
-
empty
public static <T> HttpBody<T> empty()
-
create
public static <T> HttpBody<T> create(T value, Encoder<?,?> content, long length, MediaType mediaType)
-
create
public static <T> HttpBody<T> create(Encoder<?,?> content, long length, MediaType mediaType)
-
create
public static <T> HttpBody<T> create(ByteBuffer data, MediaType mediaType)
-
create
public static <T> HttpBody<T> create(ByteBuffer data)
-
fromFile
public static <T> HttpBody<T> fromFile(String path, MediaType mediaType) throws IOException
- Throws:
IOException
-
fromFile
public static <T> HttpBody<T> fromFile(String path) throws IOException
- Throws:
IOException
-
fromResource
public static <T> HttpBody<T> fromResource(ClassLoader classLoader, String resource, MediaType mediaType) throws IOException
- Throws:
IOException
-
fromResource
public static <T> HttpBody<T> fromResource(ClassLoader classLoader, String resource) throws IOException
- Throws:
IOException
-
httpDecoder
public static <T> Decoder<HttpMessage<T>> httpDecoder(HttpMessage<?> message, Decoder<T> content, long length)
-
decodeHttp
public static <T> Decoder<HttpMessage<T>> decodeHttp(HttpMessage<?> message, Decoder<T> content, long length, InputBuffer input)
-
-