|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.hermit.android.net.WebFetcher
org.hermit.android.net.FileFetcher
public class FileFetcher
Concrete instance of WebFetcher which gets a file and stores it locally. The value passed back to the listener is the local file name as a File.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.hermit.android.net.WebFetcher |
---|
WebFetcher.FetchException, WebFetcher.Listener |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class org.hermit.android.net.WebFetcher |
---|
dataClient, dataUrls, killed, newerThanDate, timeout |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
FileFetcher(Context context,
java.net.URL url,
java.lang.String name,
WebFetcher.Listener client,
long timeout)
Fetch a file from the web. |
|
FileFetcher(Context context,
java.net.URL url,
java.lang.String name,
WebFetcher.Listener client,
long timeout,
long newer)
Fetch a file from the web. |
Method Summary | |
---|---|
protected void |
handle(java.net.URL url,
java.net.URLConnection conn,
java.io.InputStream stream)
Fetch a page of data from the given stream. |
Methods inherited from class org.hermit.android.net.WebFetcher |
---|
fetch, handle, kill, killAll, queue, run |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FileFetcher(Context context, java.net.URL url, java.lang.String name, WebFetcher.Listener client, long timeout)
context
- Application context.url
- The URL to fetch data from.name
- Local name to save the file as.client
- Client to pass the data to. It will be given
the local file name as a File object.timeout
- Maximum time in ms for which the job will be
allowed to run.public FileFetcher(Context context, java.net.URL url, java.lang.String name, WebFetcher.Listener client, long timeout, long newer)
context
- Application context.url
- The URL to fetch data from.name
- Local name to save the file as.client
- Client to pass the data to. It will be given
the local file name as a File object.timeout
- Maximum time in ms for which the job will be
allowed to run.newer
- If-modified-since time in ms UTC. The
fetch will only be carried out if the remote
resource has been modified since this time.
If zero, fetch without this condition.Method Detail |
---|
protected void handle(java.net.URL url, java.net.URLConnection conn, java.io.InputStream stream) throws WebFetcher.FetchException, java.io.IOException
handle
in class WebFetcher
url
- The URL we're reading.conn
- The current connection to the URL.stream
- The InputStream to read from.
FetchException
- Some problem was detected.
java.io.IOException
- An I/O error occurred.
WebFetcher.FetchException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |