Class FileRequestEntity
java.lang.Object
org.apache.commons.httpclient.methods.FileRequestEntity
- All Implemented Interfaces:
RequestEntity
A RequestEntity that represents a File.
- Since:
- 3.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGets the request entity's length.Gets the entity's content type.booleanTests ifRequestEntity.writeRequest(OutputStream)can be called more than once.voidwriteRequest(OutputStream out) Writes the request entity to the given stream.
-
Constructor Details
-
FileRequestEntity
-
-
Method Details
-
getContentLength
public long getContentLength()Description copied from interface:RequestEntityGets the request entity's length. This method should return a non-negative value if the content length is known or a negative value if it is not. In the latter case theEntityEnclosingMethodwill use chunk encoding to transmit the request entity.- Specified by:
getContentLengthin interfaceRequestEntity- Returns:
- a non-negative value when content length is known or a negative value when content length is not known
-
getContentType
Description copied from interface:RequestEntityGets the entity's content type. This content type will be used as the value for the "Content-Type" header.- Specified by:
getContentTypein interfaceRequestEntity- Returns:
- the entity's content type
- See Also:
-
isRepeatable
public boolean isRepeatable()Description copied from interface:RequestEntityTests ifRequestEntity.writeRequest(OutputStream)can be called more than once.- Specified by:
isRepeatablein interfaceRequestEntity- Returns:
- true if the entity can be written to
OutputStreammore than once, false otherwise.
-
writeRequest
Description copied from interface:RequestEntityWrites the request entity to the given stream.- Specified by:
writeRequestin interfaceRequestEntity- Parameters:
out-- Throws:
IOException
-