public class PathBody extends AbstractContentBody
Path.MultipartEntityBuilder| Constructor and Description |
|---|
PathBody(Path path)
Constructs a new instance for a given Path.
|
PathBody(Path path,
ContentType contentType)
Constructs a new instance for a given Path.
|
PathBody(Path path,
ContentType contentType,
String fileName)
Constructs a new instance for a given Path.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getContentLength()
Returns the body descriptors content-length.
|
String |
getFilename() |
InputStream |
getInputStream()
Gets a new input stream.
|
Path |
getPath()
Gets the source Path.
|
void |
writeTo(OutputStream out) |
getCharset, getContentType, getMediaType, getMimeType, getSubTypepublic PathBody(Path path)
path - the source Path.public PathBody(Path path, ContentType contentType)
path - the source Path.contentType - the content type.public PathBody(Path path, ContentType contentType, String fileName)
path - the source Path.contentType - the content type.fileName - The file name to override the Path's file name.public long getContentLength()
ContentDescriptorpublic String getFilename()
public InputStream getInputStream() throws IOException
IOException - if an I/O error occurspublic Path getPath()
public void writeTo(OutputStream out) throws IOException
IOExceptionCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.