Class Downloader
java.lang.Object
|
+----Downloader
- public class Downloader
- extends Object
NetRand Project
Software Engineering - CS536
University of Wisconsin - Milwaukee
Authors:
- Spring 1998 - Francis William Kasper
File: Downloader.java
Downloader calls the BinaryLinkExtractor
to extract all the links to binary files in a given HTML document. After
a list of binary file links is obtained, it places them on a stack. Each
file on the stack is downloaded eight consecutive times. The time it takes
to download the file is examined. If it is an even number, a 0 bit is recorded,
otherwise a 1 bit is recorded. One byte of entropy is obtained from each
binary file link.
-
binaryFileLinks
- a stack to hold the binary file links
-
Downloader()
-
-
collectBinaryFileLinks(String)
- collects all the binary file links for a HTML referenced by a given
URL
-
doDownload(String)
- calls getBinaryFile to perform the downloading of the binary file; downloads
the binary file eight consecutive times; from these times it records a 0
bit if the download time was even, otherwise a 1 bit is recorded.
-
getBinaryFile(URL)
- performs the actual downloading of the binary file
-
getEntropy(String)
- calls the appropriate functions to extract the binary file links from
the HTML file referenced by the given URL, perform the downloading
and sending of the random bytes.
binaryFileLinks
private Stack binaryFileLinks
- a stack to hold the binary file links
Downloader
public Downloader()
getEntropy
public void getEntropy(String urlString)
- calls the appropriate functions to extract the binary file links from
the HTML file referenced by the given URL, perform the downloading
and sending of the random bytes.
- Parameters:
- urlString - - the URL to reference the target HTML file
collectBinaryFileLinks
private void collectBinaryFileLinks(String urlString) throws Exception
- collects all the binary file links for a HTML referenced by a given
URL
- Parameters:
- urlString - - the target URL
- Throws: Exception
- is thrown if the given URL cannot be accessed
doDownload
private void doDownload(String urlString)
- calls getBinaryFile to perform the downloading of the binary file; downloads
the binary file eight consecutive times; from these times it records a 0
bit if the download time was even, otherwise a 1 bit is recorded. It
uses the BitSender class to send the random byte to the server
- Parameters:
- urlString - - the target binary file
getBinaryFile
public long getBinaryFile(URL target)
- performs the actual downloading of the binary file
- Parameters:
- target - - the target URL to download
- Returns:
- the download time is milliseconds