public class FileBody extends AbstractContentBody
| Constructor and Description |
|---|
FileBody(File file) |
FileBody(File file,
String mimeType) |
FileBody(File file,
String mimeType,
String charset) |
FileBody(File file,
String filename,
String mimeType,
String charset) |
| Modifier and Type | Method and Description |
|---|---|
String |
getCharset()
The body descriptors character set, defaulted appropriately for the MIME type.
|
long |
getContentLength()
Returns the body descriptors content-length.
|
File |
getFile() |
String |
getFilename() |
InputStream |
getInputStream() |
String |
getTransferEncoding()
Returns the body descriptors transfer encoding.
|
void |
writeTo(OutputStream out) |
getMediaType, getMimeType, getSubTypepublic FileBody(File file)
public InputStream getInputStream() throws IOException
IOExceptionpublic void writeTo(OutputStream out) throws IOException
IOExceptionpublic String getTransferEncoding()
ContentDescriptorpublic String getCharset()
ContentDescriptorThe body descriptors character set, defaulted appropriately for the MIME type.
For TEXT types, this will be defaulted to us-ascii.
For other types, when the charset parameter is missing this property will be null.
TEXT types, when unset will
be set to default us-ascii. For other types, when unset,
null will be returned.public long getContentLength()
ContentDescriptorpublic String getFilename()
public File getFile()
Copyright © 1999–2013 The Apache Software Foundation. All rights reserved.