public static interface DownloadAction.Dest
| Modifier and Type | Method and Description |
|---|---|
static DownloadAction.Dest |
file(java.io.File file)
Returns a
DownloadAction.Dest which writes its content to a File. |
java.lang.String |
getEtag()
Gets the ETag content for the resource.
|
long |
getLastModified()
Gets the LastModified timestamp millis for the current resource.
|
java.io.OutputStream |
getOutputStream()
Get the Okio
OutputStream to push the data to. |
void |
onFinished(boolean success)
Called when the file has finished downloading.
|
static DownloadAction.Dest |
path(java.nio.file.Path path)
Returns a
DownloadAction.Dest which writes its content to a Path. |
void |
setEtag(java.lang.String etag)
Set the ETag content for the current resource.
|
void |
setLastModified(long time)
Sets the LastModified timestamp millis for the current resource.
|
static DownloadAction.Dest |
stream(java.io.OutputStream os)
Returns a
DownloadAction.Destwhich writes its content to a OutputStream. |
static DownloadAction.Dest |
string(java.io.StringWriter sw)
Returns a
DownloadAction.Dest which writes its content to a StringWriter. |
static DownloadAction.Dest |
string(java.io.StringWriter sw,
java.nio.charset.Charset charset)
Returns a
DownloadAction.Dest which writes its content to a StringWriter. |
java.io.OutputStream getOutputStream()
throws java.io.IOException
OutputStream to push the data to.java.io.IOException - If an error occurs opening the output.java.lang.String getEtag()
throws java.io.IOException
java.io.IOException - If an IO Error occurs whilst reading the ETag content.void setEtag(java.lang.String etag)
throws java.io.IOException
etag - The ETag content.java.io.IOException - If an IO Error occurs whilst writing the ETag content.long getLastModified()
throws java.io.IOException
-1.java.io.IOException - If an IO Error occurs whilst reading the timestamp.void setLastModified(long time)
throws java.io.IOException
time - The LastModified millis.java.io.IOException - If an IO Error occurs whilst reading the timestamp.void onFinished(boolean success)
throws java.io.IOException
success - If the operation finished successfully.java.io.IOException - If an IO Error occurs.static DownloadAction.Dest string(java.io.StringWriter sw)
DownloadAction.Dest which writes its content to a StringWriter.
This method assumes StandardCharsets.UTF_8.
sw - The StringWriter.DownloadAction.Dest.static DownloadAction.Dest string(java.io.StringWriter sw, java.nio.charset.Charset charset)
DownloadAction.Dest which writes its content to a StringWriter.
The returned DownloadAction.Dest object does not support ETag or LastModified.
sw - The StringWriter.charset - The charset to use.DownloadAction.Dest.static DownloadAction.Dest stream(java.io.OutputStream os)
DownloadAction.Destwhich writes its content to a OutputStream.
The returned DownloadAction.Dest object does not support ETag or LastModified.
os - The OutputStream.DownloadAction.Dest.static DownloadAction.Dest file(java.io.File file)
DownloadAction.Dest which writes its content to a File.file - The file.DownloadAction.Dest.static DownloadAction.Dest path(java.nio.file.Path path)
DownloadAction.Dest which writes its content to a Path.path - The path.DownloadAction.Dest.