public class ApiUrlTestTask extends PleaseWaitRunnable
isSuccess()
replies true, otherwise false.Modifier and Type | Field and Description |
---|---|
private boolean |
canceled |
private java.net.HttpURLConnection |
connection |
private java.awt.Component |
parent |
private boolean |
success |
private java.lang.String |
url |
progressMonitor
Constructor and Description |
---|
ApiUrlTestTask(java.awt.Component parent,
java.lang.String url)
Constructs a new
ApiUrlTestTask . |
Modifier and Type | Method and Description |
---|---|
protected void |
alertConnectionFailed() |
protected void |
alertInvalidCapabilities() |
protected void |
alertInvalidCapabilitiesUrl(java.lang.String url) |
protected void |
alertInvalidServerResult(int retCode) |
protected void |
alertInvalidUrl(java.lang.String url) |
protected void |
cancel()
User pressed cancel button.
|
protected void |
finish()
Finish up the data work.
|
protected java.lang.String |
getNormalizedApiUrl()
Removes leading and trailing whitespace from the API URL and removes trailing '/'.
|
boolean |
isCanceled()
Determines if the test has been canceled.
|
boolean |
isSuccess()
Determines if the test has succeeded.
|
protected void |
realRun()
Called in the worker thread to do the actual work.
|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
private final java.lang.String url
private boolean canceled
private boolean success
private final java.awt.Component parent
private java.net.HttpURLConnection connection
public ApiUrlTestTask(java.awt.Component parent, java.lang.String url) throws java.lang.IllegalArgumentException
ApiUrlTestTask
.parent
- the parent component relative to which the PleaseWaitRunnable
-Dialog is displayedurl
- the url. Must not be null.java.lang.IllegalArgumentException
- thrown if url is null.protected void alertInvalidUrl(java.lang.String url)
protected void alertInvalidCapabilitiesUrl(java.lang.String url)
protected void alertConnectionFailed()
protected void alertInvalidServerResult(int retCode)
protected void alertInvalidCapabilities()
protected void cancel()
PleaseWaitRunnable
cancel
in class PleaseWaitRunnable
protected void finish()
PleaseWaitRunnable
finish
in class PleaseWaitRunnable
protected java.lang.String getNormalizedApiUrl()
protected void realRun() throws org.xml.sax.SAXException, java.io.IOException, OsmTransferException
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
org.xml.sax.SAXException
java.io.IOException
OsmTransferException
public boolean isCanceled()
true
if canceled, false
otherwisepublic boolean isSuccess()
true
if success, false
otherwise