WebBody.BytesBody, WebBody.PathBody| Modifier and Type | Field and Description |
|---|---|
java.nio.file.Path |
path |
| Constructor and Description |
|---|
PathBody(java.nio.file.Path path,
@Nullable java.lang.String contentType) |
| Modifier and Type | Method and Description |
|---|---|
@Nullable java.lang.String |
contentType()
The mime content type for this data.
|
long |
length()
The length of the data.
|
boolean |
multiOpenAllowed()
Checks if this WebBody supports
WebBody.open() being
called multiple times. |
java.io.InputStream |
open()
Open a stream to read the body data.
|
java.nio.channels.ReadableByteChannel |
openChannel()
Open a byte channel into a body data.
|
public PathBody(java.nio.file.Path path,
@Nullable
@Nullable java.lang.String contentType)
public java.io.InputStream open()
throws java.io.IOException
WebBodypublic java.nio.channels.ReadableByteChannel openChannel()
throws java.io.IOException
WebBody
If the underlying data does not support Channels,
the WebBody.open() InputStream will be wrapped
to a ReadableByteChannel.
openChannel in interface WebBodyjava.io.IOException - If an IO error occurs.public boolean multiOpenAllowed()
WebBodyWebBody.open() being
called multiple times.multiOpenAllowed in interface WebBodypublic long length()
WebBody@Nullable public @Nullable java.lang.String contentType()
WebBodycontentType in interface WebBody