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
AHttpEntitywhich takes its content from aTemporaryBuffer- Since:
- 3.3
-
-
Constructor Summary
Constructors Constructor Description TemporaryBufferEntity(TemporaryBuffer buffer)Construct a newHttpEntitywhich will contain the content stored in the specified buffer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close destroys the associated buffer used to buffer the entityTemporaryBuffergetBuffer()Get thebuffercontaining the contentInputStreamgetContent()longgetContentLength()booleanisRepeatable()booleanisStreaming()voidsetContentLength(int contentLength)Set thecontentLengthvoidwriteTo(OutputStream outstream)
-
-
-
Constructor Detail
-
TemporaryBufferEntity
public TemporaryBufferEntity(TemporaryBuffer buffer)
Construct a newHttpEntitywhich will contain the content stored in the specified buffer- Parameters:
buffer-
-
-
Method Detail
-
getBuffer
public TemporaryBuffer 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
public InputStream getContent() throws IOException, IllegalStateException
- Specified by:
getContentin interfaceorg.apache.http.HttpEntity- Throws:
IOExceptionIllegalStateException
-
writeTo
public void writeTo(OutputStream outstream) throws IOException
- 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
-
-