Package esmska.update
Class HttpDownloader
- java.lang.Object
-
- javax.swing.SwingWorker<java.lang.Object,java.lang.Void>
-
- esmska.update.HttpDownloader
-
- All Implemented Interfaces:
java.lang.Runnable,java.util.concurrent.Future<java.lang.Object>,java.util.concurrent.RunnableFuture<java.lang.Object>
public class HttpDownloader extends javax.swing.SwingWorker<java.lang.Object,java.lang.Void>Download file via HTTP. Returns String or byte[] depending if text or binary content was required.
-
-
Constructor Summary
Constructors Constructor Description HttpDownloader(java.lang.String url, boolean binary)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjectdoInBackground()byte[]getBinaryContent()Retrieve binary content.java.lang.StringgetTextContent()Retrieve text content.booleanisFinishedOk()Whether file was downloaded ok, or there was some error (or still running)
-
-
-
Method Detail
-
doInBackground
protected java.lang.Object doInBackground()
- Specified by:
doInBackgroundin classjavax.swing.SwingWorker<java.lang.Object,java.lang.Void>
-
getTextContent
public java.lang.String getTextContent()
Retrieve text content. Null if requested binary file or some error.
-
getBinaryContent
public byte[] getBinaryContent()
Retrieve binary content. Null if requested text file or some error.
-
isFinishedOk
public boolean isFinishedOk()
Whether file was downloaded ok, or there was some error (or still running)
-
-