Class SEDownloader
java.lang.Object
org.gvsig.compat.se.net.downloader.se.SEDownloader
- All Implemented Interfaces:
org.gvsig.compat.net.Downloader,Downloader
Clase con métodos de utilidad en el protocolo WMS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDownloadedURL(URL url, String filePath) Adds an URL to the table of downloaded files for further uses.voidCleans every temporal file previously downloaded.protected RunnablecreateDownloaderTask(SEDownloader downloader, Executor executor, URL url, String data, File target, Object groupID, int maxbytes) protected RunnablecreateDownloaderTask(SEDownloader downloader, Executor executor, URL url, String method, org.apache.http.entity.ContentType contenttype, String data, File target, Object groupID, int maxbytes) downloadFile(URL url, String data, String name, org.gvsig.compat.net.ICancellable cancel) Downloads a URL using the HTTP Post protocoldownloadFile(URL url, String data, String name, org.gvsig.compat.net.ICancellable cancel, int maxbytes) downloadFile(URL url, String method, org.apache.http.entity.ContentType contenttype, String data, String name, org.gvsig.compat.net.ICancellable cancel) downloadFile(URL url, String method, org.apache.http.entity.ContentType contenttype, String data, String name, org.gvsig.compat.net.ICancellable cancel, int maxbytes) downloadFile(URL url, String method, org.apache.http.entity.ContentType contenttype, String data, String name, org.gvsig.compat.net.ICancellable cancel, int maxbytes, boolean useCache) downloadFile(URL url, String name, org.gvsig.compat.net.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.booleangetCanceled(Object groupId) Try if a group of downloads has been canceledlongprotected FilegetPreviousDownloadedURL(URL url, String data) Return the content of a file that has been created from a URL using the HTTP POST protocolprotected FilegetUniqueTemporaryFile(String name) voidRemove an URL from the system cache.voidRemove an URL from the system cache.voidsetCanceled(Object groupId, boolean isCanceled) Cancel a group of downloadsvoidsetDownloadException(Exception exception)
-
Constructor Details
-
SEDownloader
public SEDownloader()
-
-
Method Details
-
getExecutorUI
-
getPreviousDownloadedURL
Return the content of a file that has been created from a URL using the HTTP POST protocol- Parameters:
url- The URLdata- The data to send on the query- Returns:
- File containing this URL's content or null if no file was found.
-
addDownloadedURL
Adds an URL to the table of downloaded files for further uses. If the URL already exists in the table its filePath value is updated to the new one and the old file itself is removed from the file system.- Specified by:
addDownloadedURLin interfaceDownloader- Parameters:
url-filePath-
-
downloadFile
public File downloadFile(URL url, String name, org.gvsig.compat.net.ICancellable cancel) throws IOException, ConnectException, UnknownHostException 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.- Specified by:
downloadFilein interfaceorg.gvsig.compat.net.Downloader- Parameters:
url-name-- Returns:
- Throws:
IOExceptionConnectExceptionUnknownHostException
-
downloadFile
public File downloadFile(URL url, String data, String name, org.gvsig.compat.net.ICancellable cancel) throws IOException, ConnectException, UnknownHostException Downloads a URL using the HTTP Post protocol- Specified by:
downloadFilein interfaceorg.gvsig.compat.net.Downloader- Parameters:
url- The server URLdata- The data to send in the requestname- A common name for all the retrieved filescancel- Used to cancel the downloads- Returns:
- The retrieved file
- Throws:
IOExceptionConnectExceptionUnknownHostException
-
downloadFile
public File downloadFile(URL url, String data, String name, org.gvsig.compat.net.ICancellable cancel, int maxbytes) throws IOException, ConnectException, UnknownHostException - Specified by:
downloadFilein interfaceorg.gvsig.compat.net.Downloader- Throws:
IOExceptionConnectExceptionUnknownHostException
-
downloadFile
public File downloadFile(URL url, String method, org.apache.http.entity.ContentType contenttype, String data, String name, org.gvsig.compat.net.ICancellable cancel) throws IOException, ConnectException, UnknownHostException - Specified by:
downloadFilein interfaceorg.gvsig.compat.net.Downloader- Throws:
IOExceptionConnectExceptionUnknownHostException
-
downloadFile
public File downloadFile(URL url, String method, org.apache.http.entity.ContentType contenttype, String data, String name, org.gvsig.compat.net.ICancellable cancel, int maxbytes) throws IOException, ConnectException, UnknownHostException - Specified by:
downloadFilein interfaceorg.gvsig.compat.net.Downloader- Throws:
IOExceptionConnectExceptionUnknownHostException
-
downloadFile
public File downloadFile(URL url, String method, org.apache.http.entity.ContentType contenttype, String data, String name, org.gvsig.compat.net.ICancellable cancel, int maxbytes, boolean useCache) throws IOException, ConnectException, UnknownHostException - Specified by:
downloadFilein interfaceorg.gvsig.compat.net.Downloader- Throws:
IOExceptionConnectExceptionUnknownHostException
-
getCanceled
Try if a group of downloads has been canceled- Specified by:
getCanceledin interfaceDownloader- Parameters:
groupId- Group id- Returns:
- If the group has been canceled
-
setCanceled
Cancel a group of downloads- Specified by:
setCanceledin interfaceDownloader- Parameters:
groupId- Group idisCanceled- if the group has to be canceled
-
removeURL
Remove an URL from the system cache. The file will remain in the file system for further eventual uses.- Specified by:
removeURLin interfaceorg.gvsig.compat.net.Downloader- Parameters:
url-
-
removeURL
Remove an URL from the system cache. The file will remain in the file system for further eventual uses.- Specified by:
removeURLin interfaceorg.gvsig.compat.net.Downloader- Parameters:
url-
-
setDownloadException
- Specified by:
setDownloadExceptionin interfaceDownloader
-
getLatency
public long getLatency()- Specified by:
getLatencyin interfaceDownloader
-
createDownloaderTask
-
createDownloaderTask
-
cleanUpTempFiles
public void cleanUpTempFiles()Cleans every temporal file previously downloaded.- Specified by:
cleanUpTempFilesin interfaceorg.gvsig.compat.net.Downloader
-
getUniqueTemporaryFile
-