Class TemporaryBufferEntity
java.lang.Object
org.apache.http.entity.AbstractHttpEntity
org.eclipse.jgit.transport.http.apache.TemporaryBufferEntity
- All Implemented Interfaces:
AutoCloseable,org.apache.http.HttpEntity
public class TemporaryBufferEntity
extends org.apache.http.entity.AbstractHttpEntity
implements AutoCloseable
A
HttpEntity which takes its content from a
TemporaryBuffer- Since:
- 3.3
-
Field Summary
FieldsFields inherited from class org.apache.http.entity.AbstractHttpEntity
chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionTemporaryBufferEntity(TemporaryBuffer buffer) Construct a newHttpEntitywhich will contain the content stored in the specified buffer -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close destroys the associated buffer used to buffer the entityGet thebuffercontaining the contentlongbooleanbooleanvoidsetContentLength(int contentLength) Set thecontentLengthvoidwriteTo(OutputStream outstream) Methods inherited from class org.apache.http.entity.AbstractHttpEntity
consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType, toString
-
Field Details
-
buffer
-
contentLength
-
-
Constructor Details
-
TemporaryBufferEntity
Construct a newHttpEntitywhich will contain the content stored in the specified buffer- Parameters:
buffer-
-
-
Method Details
-
getBuffer
Get thebuffercontaining the content- Returns:
- buffer containing the content
-
isRepeatable
public boolean isRepeatable()- Specified by:
isRepeatablein interfaceorg.apache.http.HttpEntity
-
getContentLength
public long getContentLength()- Specified by:
getContentLengthin interfaceorg.apache.http.HttpEntity
-
getContent
- Specified by:
getContentin interfaceorg.apache.http.HttpEntity- Throws:
IOExceptionIllegalStateException
-
writeTo
- Specified by:
writeToin interfaceorg.apache.http.HttpEntity- Throws:
IOException
-
isStreaming
public boolean isStreaming()- Specified by:
isStreamingin interfaceorg.apache.http.HttpEntity
-
setContentLength
public void setContentLength(int contentLength) Set thecontentLength- Parameters:
contentLength-
-
close
public void close()Close destroys the associated buffer used to buffer the entity- Specified by:
closein interfaceAutoCloseable- Since:
- 4.5
-