|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DownloadOutput
Used by VersionControlClient
's download methods to support writing to
multiple output streams simultaneously. Each output can have its own content
type preference (auto gunzip or not).
Callers can see which content type was actually written to the output stream
by calling getActualContentType()
.
Method Summary | |
---|---|
void |
closeOutputStream()
Called to close the OutputStream if it was open. |
java.lang.String |
getActualContentType()
|
java.io.OutputStream |
getOutputStream()
Gets the OutputStream to write bytes to. |
boolean |
isAutoGunzip()
|
void |
resetOutputStream()
Called by the download process if a transient download error happened and the download will be retried with a new output stream. |
void |
setActualContentType(java.lang.String type)
Sets the content type of the data that was actually written to the output stream during the download. |
Method Detail |
---|
java.io.OutputStream getOutputStream() throws java.io.IOException
OutputStream
to write bytes to. See the notes on
resetOutputStream()
on recreating a stream after a transient
download failure.
OutputStream
this class was constructed with (never
null
)
java.io.IOException
void resetOutputStream() throws java.io.IOException
getOutputStream()
will be called after this method to obtain the
output stream to retry the download with. If an implementation returns
the same stream after resetOutputStream()
is called, it should
rewind or reset the stream to accept the first bytes of the download
again.
Implementations are not required to implement this method and may throw
an IOException
if they choose not to.
java.io.IOException
void closeOutputStream() throws java.io.IOException
OutputStream
if it was open. Safe to call
again on an already-closed output.
java.io.IOException
boolean isAutoGunzip()
true
if the download process should gunzip the bytes
before writing them to the output stream; false
if
the download process should write unprocessed bytesvoid setActualContentType(java.lang.String type)
type
- the type that was written (must not be null
, must be
one of the types defined by DownloadContentTypes
)java.lang.String getActualContentType()
null
if the
download did not completeDownloadContentTypes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |