public class SEDownloader extends Object implements Downloader
Constructor and Description |
---|
SEDownloader() |
Modifier and Type | Method and Description |
---|---|
void |
addDownloadedURL(URL url,
String filePath)
Adds an URL to the table of downloaded files for further uses.
|
void |
cleanUpTempFiles()
Cleans every temporal file previously downloaded.
|
protected Runnable |
createDownloaderTask(Downloader downloader,
URL url,
String data,
File target,
Object groupID,
int maxbytes) |
File |
downloadFile(URL url,
String name,
ICancellable cancel)
Downloads an URL into a temporary file that is removed the next time the
tempFileManager class is called, which means the next time gvSIG is
launched.
|
File |
downloadFile(URL url,
String data,
String name,
ICancellable cancel)
Downloads a URL using the HTTP Post protocol
|
File |
downloadFile(URL url,
String data,
String name,
ICancellable cancel,
int maxbytes) |
boolean |
getCanceled(Object groupId)
Try if a group of downloads has been canceled
|
long |
getLatency() |
void |
removeURL(Object url)
Remove an URL from the system cache.
|
void |
removeURL(URL url)
Remove an URL from the system cache.
|
void |
setCanceled(Object groupId,
boolean isCanceled)
Cancel a group of downloads
|
void |
setDownloadException(Exception exception) |
public void addDownloadedURL(URL url, String filePath)
url
- filePath
- public File downloadFile(URL url, String name, ICancellable cancel) throws IOException, ConnectException, UnknownHostException
downloadFile
in interface Downloader
url
- name
- IOException
ConnectException
UnknownHostException
public File downloadFile(URL url, String data, String name, ICancellable cancel) throws IOException, ConnectException, UnknownHostException
downloadFile
in interface Downloader
url
- The server URLdata
- The data to send in the requestname
- A common name for all the retrieved filescancel
- Used to cancel the downloadsIOException
ConnectException
UnknownHostException
public File downloadFile(URL url, String data, String name, ICancellable cancel, int maxbytes) throws IOException, ConnectException, UnknownHostException
downloadFile
in interface Downloader
IOException
ConnectException
UnknownHostException
public boolean getCanceled(Object groupId)
groupId
- Group idpublic void setCanceled(Object groupId, boolean isCanceled)
groupId
- Group idisCanceled
- if the group has to be canceledpublic void cleanUpTempFiles()
cleanUpTempFiles
in interface Downloader
public void removeURL(URL url)
removeURL
in interface Downloader
url
- public void removeURL(Object url)
removeURL
in interface Downloader
url
- public void setDownloadException(Exception exception)
public long getLatency()