|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.clients.dndMicroApplet.ContentDownloader
Runnable which downloads from a specified URL to a specified file and uses a specified applet to update the user as to progress of the operation. Intended for usage from background threads.
Note that file download progress dialogs are quite doable instead of using showStatus() as is done currently. The current approach was selected for simplicity, unobtrusiveness, and small size of this class.
Field Summary | |
private Applet |
applet
Applet to show status through and as a source of Locale |
private static int |
BUFFER_SIZE
Size of buffer used for download |
private File |
newFile
Newly created file to download to |
private ResourceBundle |
rb
Resource bundle to use for localization |
private static char |
REPL_CHAR
Safe replacement character for ' in MessageFormat strings. |
private URL |
sourceURL
URL to download from |
Constructor Summary | |
(package private) |
ContentDownloader(Applet applet,
URL sourceURL,
File newFile)
Takes applet to allow use of showStatus() and getLocale(), a URL to download from, and a newly created file to download to. |
Method Summary | |
private void |
delete(File file)
Delete file via FileOperation |
private FileOutputStream |
getFileOutputStream(File file)
Get file output stream for file via FileOperation |
void |
run()
Workhorse method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final char REPL_CHAR
private static final int BUFFER_SIZE
private Applet applet
private URL sourceURL
private File newFile
private ResourceBundle rb
Constructor Detail |
ContentDownloader(Applet applet, URL sourceURL, File newFile)
Method Detail |
public void run()
run
in interface Runnable
private FileOutputStream getFileOutputStream(File file) throws Exception
Exception
private void delete(File file)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |