|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.httpclient.methods.InputStreamRequestEntity
public class InputStreamRequestEntity
A RequestEntity that contains an InputStream.
Field Summary | |
---|---|
static int |
CONTENT_LENGTH_AUTO
The content length will be calculated automatically. |
Constructor Summary | |
---|---|
InputStreamRequestEntity(InputStream content)
Creates a new InputStreamRequestEntity with the given content and a content type of CONTENT_LENGTH_AUTO . |
|
InputStreamRequestEntity(InputStream content,
long contentLength)
Creates a new InputStreamRequestEntity with the given content and content length. |
|
InputStreamRequestEntity(InputStream content,
long contentLength,
String contentType)
Creates a new InputStreamRequestEntity with the given content, content length, and content type. |
|
InputStreamRequestEntity(InputStream content,
String contentType)
Creates a new InputStreamRequestEntity with the given content, content type, and a content length of CONTENT_LENGTH_AUTO . |
Method Summary | |
---|---|
InputStream |
getContent()
|
long |
getContentLength()
Gets the content length. |
String |
getContentType()
Gets the entity's content type. |
boolean |
isRepeatable()
Tests if this method is repeatable. |
void |
writeRequest(OutputStream out)
Writes the request entity to the given stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CONTENT_LENGTH_AUTO
Constructor Detail |
---|
public InputStreamRequestEntity(InputStream content)
CONTENT_LENGTH_AUTO
.
content
- The content to set.public InputStreamRequestEntity(InputStream content, String contentType)
CONTENT_LENGTH_AUTO
.
content
- The content to set.contentType
- The type of the content, or null
.public InputStreamRequestEntity(InputStream content, long contentLength)
content
- The content to set.contentLength
- The content size in bytes or a negative number if not known.
If CONTENT_LENGTH_AUTO
is given the content will be buffered in order to
determine its size when getContentLength()
is called.public InputStreamRequestEntity(InputStream content, long contentLength, String contentType)
content
- The content to set.contentLength
- The content size in bytes or a negative number if not known.
If CONTENT_LENGTH_AUTO
is given the content will be buffered in order to
determine its size when getContentLength()
is called.contentType
- The type of the content, or null
.Method Detail |
---|
public String getContentType()
getContentType
in interface RequestEntity
HttpMethod.setRequestHeader(String, String)
public boolean isRepeatable()
isRepeatable
in interface RequestEntity
true
if the content has been buffered.getContentLength()
public void writeRequest(OutputStream out) throws IOException
writeRequest
in interface RequestEntity
IOException
public long getContentLength()
getContentLength
in interface RequestEntity
public InputStream getContent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |