public class URLDownload
extends java.lang.Object
| Constructor and Description |
|---|
URLDownload(java.awt.Component _parent,
java.net.URL _source,
java.io.File _dest)
URL download to a file.
|
URLDownload(java.net.URL _source)
URL download to a string.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copy(java.io.InputStream in,
java.io.OutputStream out) |
void |
copy(java.io.InputStream in,
java.io.Writer out) |
void |
download() |
protected void |
downloadToFile() |
protected void |
downloadToString() |
java.lang.String |
getMimeType() |
java.lang.String |
getStringContent()
This method can be used after download() has been called, to get the contents
of the download, provided this URLDownload was created with the constructor
that takes no File argument.
|
java.net.URLConnection |
getURLConnection() |
void |
openConnectionOnly() |
void |
setEncoding(java.lang.String encoding) |
public URLDownload(java.net.URL _source)
_source - The URL to download.public URLDownload(java.awt.Component _parent,
java.net.URL _source,
java.io.File _dest)
_parent - Parent component._source - The URL to download._dest - The file to download into.public void setEncoding(java.lang.String encoding)
public java.lang.String getMimeType()
public java.net.URLConnection getURLConnection()
public java.lang.String getStringContent()
public void openConnectionOnly()
throws java.io.IOException
java.io.IOExceptionpublic void download()
throws java.io.IOException
java.io.IOExceptionprotected void downloadToString()
throws java.io.IOException
java.io.IOExceptionprotected void downloadToFile()
throws java.io.IOException
java.io.IOExceptionpublic void copy(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic void copy(java.io.InputStream in,
java.io.Writer out)
throws java.io.IOException
java.io.IOException