java.lang.Object
java.lang.Thread
io.sf.carte.doc.agent.net.ResourceDownloader<C>
- All Implemented Interfaces:
Runnable
Asynchronous downloading of an embedded resource of a given type.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(DownloadListener<C> listener) protected abstract ResourceAgent
<C, ?> getURL()
boolean
isDone()
protected void
protected void
protected InputStream
protected abstract void
Reads content from a stream and transforms it to native content.void
run()
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
nativeContent
-
listeners
-
-
Constructor Details
-
ResourceDownloader
-
ResourceDownloader
- Throws:
IllegalArgumentException
-
-
Method Details
-
getURL
-
addListener
-
isDone
public boolean isDone() -
run
public void run() -
openStream
- Throws:
IOException
-
getContentType
-
readContent
Reads content from a stream and transforms it to native content.- Parameters:
is
- the stream with the content.- Throws:
IOException
- if an error occurs when reading the stream.
-
getResourceAgent
-
notifyDownload
protected void notifyDownload() -
notifyFailure
-
getNativeContent
-