Class InputStreamBodyWithLength
java.lang.Object
org.apache.http.entity.mime.content.AbstractContentBody
org.apache.http.entity.mime.content.InputStreamBody
org.apache.sling.testing.clients.util.InputStreamBodyWithLength
- All Implemented Interfaces:
org.apache.http.entity.mime.content.ContentBody
,org.apache.http.entity.mime.content.ContentDescriptor
public class InputStreamBodyWithLength
extends org.apache.http.entity.mime.content.InputStreamBody
If we want to upload a file that is a resource in a jar file, the http client expects a content length.
-
Constructor Summary
ConstructorsConstructorDescriptionInputStreamBodyWithLength
(String resourcePath, String contentType, String fileName) -
Method Summary
Methods inherited from class org.apache.http.entity.mime.content.InputStreamBody
getFilename, getInputStream, getTransferEncoding, writeTo
Methods inherited from class org.apache.http.entity.mime.content.AbstractContentBody
getCharset, getContentType, getMediaType, getMimeType, getSubType
-
Constructor Details
-
InputStreamBodyWithLength
public InputStreamBodyWithLength(String resourcePath, String contentType, String fileName) throws ClientException - Throws:
ClientException
-
-
Method Details
-
getContentLength
public long getContentLength()- Specified by:
getContentLength
in interfaceorg.apache.http.entity.mime.content.ContentDescriptor
- Overrides:
getContentLength
in classorg.apache.http.entity.mime.content.InputStreamBody
-