|
Spreadsheet Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--corpus.fetcher.Fetcher
Reads the URLs to be downloaded from a file, fetches the files, and stores them. http://www.javaworld.com/javaworld/javatips/jw-javatip19.html
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Fetcher(int me)
Constructor for the Fetcher object. |
|
Fetcher(int me,
java.lang.String auth)
|
Method Summary | |
void |
addURLs(java.lang.String[] newurls)
Add a array of urls to the pending tasks. |
static corpus.fetcher.Task |
getWork()
The threads get their next job here. |
static void |
main(java.lang.String[] args)
The main program for the Fetcher class |
static java.util.Vector |
possible(java.lang.String path)
Given a path to look in, this method will return all the search files. |
void |
run()
Main processing method for the Fetcher object |
static void |
setup(java.util.Vector st)
Add a vector of urls to fetch. |
static void |
startThreads(int num)
Create a pool of threads to do some work. |
void |
store(java.lang.String outputfile,
byte[] outfile,
java.lang.String searchTerm,
java.lang.String url)
Store a byte array version of the file on the harddisk. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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 Fetcher(int me)
me
- thread numberpublic Fetcher(int me, java.lang.String auth)
Method Detail |
public static corpus.fetcher.Task getWork()
public static void main(java.lang.String[] args)
args
- usage: java corpus.Fetcher number-of-threadspublic static void setup(java.util.Vector st)
public void addURLs(java.lang.String[] newurls)
newurls
- Array of input urls as Strings.public static void startThreads(int num)
num
- number of threads to startpublic static java.util.Vector possible(java.lang.String path)
public void store(java.lang.String outputfile, byte[] outfile, java.lang.String searchTerm, java.lang.String url)
outputfile
- File name for diskoutfile
- The data to storepublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
Spreadsheet Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |