public class FileBody extends AbstractContentBody
MultipartEntityBuilder
Modifier and Type | Field and Description |
---|---|
private java.io.File |
file |
private java.lang.String |
filename |
Constructor and Description |
---|
FileBody(java.io.File file) |
FileBody(java.io.File file,
org.apache.http.entity.ContentType contentType) |
FileBody(java.io.File file,
org.apache.http.entity.ContentType contentType,
java.lang.String filename) |
FileBody(java.io.File file,
java.lang.String mimeType)
Deprecated.
(4.3) use
FileBody(File, ContentType)
or MultipartEntityBuilder |
FileBody(java.io.File file,
java.lang.String mimeType,
java.lang.String charset)
Deprecated.
(4.3) use
FileBody(File, ContentType)
or MultipartEntityBuilder |
FileBody(java.io.File file,
java.lang.String filename,
java.lang.String mimeType,
java.lang.String charset)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
long |
getContentLength()
Returns the body descriptors content-length.
|
java.io.File |
getFile() |
java.lang.String |
getFilename() |
java.io.InputStream |
getInputStream() |
java.lang.String |
getTransferEncoding()
Returns the body descriptors transfer encoding.
|
void |
writeTo(java.io.OutputStream out) |
getCharset, getContentType, getMediaType, getMimeType, getSubType
@Deprecated public FileBody(java.io.File file, java.lang.String filename, java.lang.String mimeType, java.lang.String charset)
FileBody(File, ContentType, String)
or MultipartEntityBuilder
@Deprecated public FileBody(java.io.File file, java.lang.String mimeType, java.lang.String charset)
FileBody(File, ContentType)
or MultipartEntityBuilder
@Deprecated public FileBody(java.io.File file, java.lang.String mimeType)
FileBody(File, ContentType)
or MultipartEntityBuilder
public FileBody(java.io.File file)
public FileBody(java.io.File file, org.apache.http.entity.ContentType contentType, java.lang.String filename)
public FileBody(java.io.File file, org.apache.http.entity.ContentType contentType)
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
public void writeTo(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public java.lang.String getTransferEncoding()
ContentDescriptor
public long getContentLength()
ContentDescriptor
public java.lang.String getFilename()
public java.io.File getFile()