public class DownloadTool extends Task<Object,File>
followRedirects is true,
it will try to follow the redirects until it reaches the file or detects a redirection loop.| Constructor and Description |
|---|
DownloadTool() |
| Modifier and Type | Method and Description |
|---|---|
DownloadTool |
followRedirects(boolean followRedirects)
Sets whether to follow redirects.
|
DownloadTool |
from(String url) |
DownloadTool |
from(URL url) |
protected File |
process(Object input) |
DownloadTool |
property(String key,
String value)
Sets a HTTP property with the given key.
|
DownloadTool |
timeout(int timeout)
Sets the read timeout of the HTTP request.
|
DownloadTool |
to(File file) |
DownloadTool |
to(String filePath) |
execute, getExecutionService, run, setExecutionService, setPreviousTask, then, thenpublic DownloadTool from(String url) throws IllegalArgumentException
IllegalArgumentExceptionpublic DownloadTool from(URL url)
public DownloadTool to(String filePath)
public DownloadTool to(File file)
public DownloadTool timeout(int timeout)
timeout - URLConnection.setReadTimeout(int)public DownloadTool property(String key, String value)
key - value - URLConnection.setRequestProperty(String, String)public DownloadTool followRedirects(boolean followRedirects)
followRedirects - Copyright © 2015 JBoss by Red Hat. All rights reserved.