|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.PleaseWaitRunnable
org.openstreetmap.josm.gui.io.DownloadFileTask
public class DownloadFileTask
Asynchronous task for downloading andnd unpacking arbitrary file lists Shows progress bar when donloading
Nested Class Summary | |
---|---|
private static class |
DownloadFileTask.DownloadException
|
Field Summary | |
---|---|
private java.lang.String |
address
|
private boolean |
canceled
|
private java.net.URLConnection |
downloadConnection
|
private java.io.File |
file
|
private boolean |
mkdir
|
private boolean |
unpack
|
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable |
---|
progressMonitor |
Constructor Summary | |
---|---|
DownloadFileTask(java.awt.Component parent,
java.lang.String address,
java.io.File file,
boolean mkdir,
boolean unpack)
Creates the download task |
Method Summary | |
---|---|
protected void |
cancel()
User pressed cancel button. |
private void |
closeConnectionIfNeeded()
|
void |
download()
|
protected void |
finish()
Finish up the data work. |
boolean |
isCanceled()
Replies true if the task was canceled by the user |
protected void |
realRun()
Called in the worker thread to do the actual work. |
static void |
unzipFileRecursively(java.io.File file,
java.lang.String dir)
Recursive unzipping function TODO: May be placed somewhere else - Tools.Utils? |
Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable |
---|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.lang.String address
private final java.io.File file
private final boolean mkdir
private final boolean unpack
private boolean canceled
private java.net.URLConnection downloadConnection
Constructor Detail |
---|
public DownloadFileTask(java.awt.Component parent, java.lang.String address, java.io.File file, boolean mkdir, boolean unpack)
parent
- the parent component relative to which the PleaseWaitDialog
is displayedtitle
- the title to display in the PleaseWaitDialog
java.lang.IllegalArgumentException
- thrown if toUpdate is nullMethod Detail |
---|
private void closeConnectionIfNeeded()
protected void cancel()
PleaseWaitRunnable
cancel
in class PleaseWaitRunnable
protected void finish()
PleaseWaitRunnable
finish
in class PleaseWaitRunnable
public void download() throws DownloadFileTask.DownloadException
DownloadFileTask.DownloadException
protected void realRun() throws org.xml.sax.SAXException, java.io.IOException
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
org.xml.sax.SAXException
java.io.IOException
public boolean isCanceled()
public static void unzipFileRecursively(java.io.File file, java.lang.String dir) throws java.io.IOException
file
- dir
-
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |