es.prodevelop.gvsig.mobile.fmap.util.download
Class DownloadTask
java.lang.Object
es.prodevelop.gvsig.mobile.fmap.util.download.DownloadTask
- All Implemented Interfaces:
- java.lang.Runnable
- public class DownloadTask
- extends java.lang.Object
- implements java.lang.Runnable
This class is used to download resources in a separate thread, so it can be cancelled.
- Author:
- jldominguez
- See Also:
Downloader
Constructor Summary |
DownloadTask(java.net.URL u,
java.lang.String exte,
int _type,
java.io.File dest_file)
Constructor |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BYTE_ARRAY
public static final int BYTE_ARRAY
- See Also:
- Constant Field Values
FILE
public static final int FILE
- See Also:
- Constant Field Values
DownloadTask
public DownloadTask(java.net.URL u,
java.lang.String exte,
int _type,
java.io.File dest_file)
- Constructor
- Parameters:
u
- the URLexte
- the local file extension_type
- whether it is a file download or an array of bytesdest_file
- destination file
isDone
public boolean isDone()
- Returns:
- whether the download is finished
cancel
public void cancel()
- Switches the state to cancelled, so the download should be cancelled
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
- See Also:
Runnable.run()
getDownloadedObject
public java.lang.Object getDownloadedObject()
- Returns:
- the result object (file or byte array)