Package org.apache.sling.testing.clients.util

# 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

Constructors
Constructor
Description
`InputStreamBodyWithLength(String resourcePath, String contentType, String fileName)`

## Method Summary

Modifier and Type
Method
Description
`long`
`getContentLength()`

### 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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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 interface `org.apache.http.entity.mime.content.ContentDescriptor`
Overrides:
  `getContentLength` in class `org.apache.http.entity.mime.content.InputStreamBody`