public class URLTransfer extends DataTransfer
URLTransfer
class initiates a connection to an
Internet host specified by a URL and downloads the content provided
by the URL. The URL may contain username and password information,
in which case the URL is opened using a
PasswordAuthentication
object as the default
authenticator for the connection.Constructor and Description |
---|
URLTransfer(java.net.URL inputUrl,
java.io.OutputStream output)
Creates a new URL transfer with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
protected void |
setupIO()
Overrides the parent to setup I/O streams.
|
abort, addDataTransferListener, close, getRate, getStartTime, getTransferred, removeDataTransferListener, run, setStreams
public URLTransfer(java.net.URL inputUrl, java.io.OutputStream output)
inputUrl
- the URL to access for content.output
- the output stream for the URL contents.protected void setupIO() throws java.io.IOException
setupIO
in class DataTransfer
java.io.IOException
- if an error occurred accessing the URL stream.