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, getSubType
public FileBody(File file)
public InputStream getInputStream() throws IOException
IOException
public void writeTo(OutputStream out) throws IOException
IOException
public String getTransferEncoding()
ContentDescriptor
public String getCharset()
ContentDescriptor
The 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()
ContentDescriptor
public String getFilename()
public File getFile()
Copyright © 1999-2013 The Apache Software Foundation. All Rights Reserved.