javax.activation
Class URLDataSource
java.lang.Object
javax.activation.URLDataSource
- DataSource
public class URLDataSource
extends java.lang.Object
URLDataSource(URL url) - Creates a URLDataSource from a URL object.
|
String | getContentType() - Returns the value of the URL content-type header field.
|
InputStream | getInputStream() - Returns an InputStream obtained from the URL.
|
String | getName() - Returns the file name of the URL object.
|
OutputStream | getOutputStream() - Returns an OutputStream obtained from the URL.
|
URL | getURL() - Returns the URL of the data source.
|
URLDataSource
public URLDataSource(URL url)
Creates a URLDataSource from a URL object.
getContentType
public String getContentType()
Returns the value of the URL content-type header field.
This method calls URL.openConnection() to obtain a connection
from which to obtain the content type. If this fails or
a getContentType() returns null then "application/octet-stream"
is returned.
- getContentType in interface DataSource
getInputStream
public InputStream getInputStream()
throws IOException
Returns an InputStream obtained from the URL.
- getInputStream in interface DataSource
- the InputStream from URL.openStream()
getName
public String getName()
Returns the file name of the URL object.
- getName in interface DataSource
- the name as returned by URL.getFile()
getOutputStream
public OutputStream getOutputStream()
throws IOException
Returns an OutputStream obtained from the URL.
- getOutputStream in interface DataSource
getURL
public URL getURL()
Returns the URL of the data source.