javax.activation
Class URLDataSource
java.lang.Object
javax.activation.URLDataSource
- DataSource
public class URLDataSource
extends java.lang.Object
DataSource implementation that retrieves its data from a URL.
String | getContentType() - Returns the Content-Type header for the URL.
|
InputStream | getInputStream() - Returns an input stream from which the data can be read.
|
String | getName() - Returns the result of
getFile of the underlying URL.
|
OutputStream | getOutputStream() - Returns an output stream to which the data can be written.
|
URL | getURL() - Returns the underlying URL.
|
URLDataSource
public URLDataSource(URL url)
Constructor.
This will not open the connection to the URL.
getContentType
public String getContentType()
Returns the Content-Type header for the URL.
In the case of failure or lack of such a header,
returns "application/octet-stream".
- getContentType in interface DataSource
getInputStream
public InputStream getInputStream()
throws IOException
Returns an input stream from which the data can be read.
- getInputStream in interface DataSource
getName
public String getName()
Returns the result of getFile
of the underlying URL.
- getName in interface DataSource
getOutputStream
public OutputStream getOutputStream()
throws IOException
Returns an output stream to which the data can be written.
- getOutputStream in interface DataSource
getURL
public URL getURL()
Returns the underlying URL.