public abstract class AbstractDownload extends Observable implements Download, Runnable, Comparable
Download.State| Modifier and Type | Field and Description |
|---|---|
protected Exception |
caughtException |
protected String |
directory |
protected Future |
downloadFuture |
protected File |
fileToSaveTo |
protected static org.apache.log4j.Logger |
log |
protected boolean |
started |
protected Download.State |
status |
protected String |
title |
| Constructor and Description |
|---|
AbstractDownload() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Object o) |
protected void |
determineDestinationFile(String filename,
String extension)
Determines the destination file for this download.
|
boolean |
equals(Object obj) |
protected void |
error(Exception exception)
Logs a caught exception and sets some members accordingly.
|
Exception |
getCaughtException()
Returns the exception which is caught during the download.
|
int |
getDownloadsCompleted()
Returns the count of completed downloads this Download object encapsulates.
|
int |
getDownloadsErroneous()
Returns the count of erraneous downloads this Download object encapsulates.
|
int |
getDownloadsTotal()
Returns the count of downloads this Download object encapsulates.
|
JPanel |
getExceptionPanel(Exception exception)
Returns a JPanel which visualizes the given exception.
|
File |
getFileToSaveTo()
Returns a file object pointing to the download location of this download.
|
Download.State |
getStatus()
Returns the status of this download.
|
String |
getTitle()
Returns the title of the download.
|
int |
hashCode() |
abstract void |
run() |
static void |
setParallelDownloads(int parallelDownloads)
DOCUMENT ME!
|
void |
startDownload()
Starts a thread which starts the download by starting this Runnable.
|
protected void |
stateChanged()
Marks this observable as changed and notifies observers.
|
protected void |
titleChanged()
DOCUMENT ME!
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddObserver, deleteObserver, getProgressprotected static final org.apache.log4j.Logger log
protected String directory
protected File fileToSaveTo
protected Download.State status
protected String title
protected Future downloadFuture
protected boolean started
protected Exception caughtException
public String getTitle()
public File getFileToSaveTo()
getFileToSaveTo in interface Downloadpublic Download.State getStatus()
public Exception getCaughtException()
getCaughtException in interface Downloadpublic int getDownloadsTotal()
DownloadgetDownloadsTotal in interface Downloadpublic int getDownloadsCompleted()
DownloadgetDownloadsCompleted in interface Downloadpublic int getDownloadsErroneous()
DownloadgetDownloadsErroneous in interface Downloadprotected void error(Exception exception)
exception - The caught exception.public void startDownload()
startDownload in interface Downloadpublic JPanel getExceptionPanel(Exception exception)
DownloadgetExceptionPanel in interface Downloadexception - The exception to visualize.protected void determineDestinationFile(String filename, String extension)
filename - The file name for this download.extension - The extension for the downloaded file.protected void stateChanged()
protected void titleChanged()
public int compareTo(Object o)
compareTo in interface Comparablepublic static void setParallelDownloads(int parallelDownloads)
parallelDownloads - DOCUMENT ME!Copyright © 2012–2026 cismet GmbH. All rights reserved.