Class URLDataSource

The URLDataSource class provides an object that wraps a URL
object in a DataSource interface. URLDataSource simplifies the handling
of data described by URLs within the JavaBeans Activation Framework
because this class can be used to create new DataHandlers. NOTE: The
DataHandler object creates a URLDataSource internally,
when it is constructed with a URL.

Method Detail

getContentType

Returns the value of the URL content-type header field.
It calls the URL's URLConnection.getContentType method
after retrieving a URLConnection object.
Note: this method attempts to call the openConnection
method on the URL. If this method fails, or if a content type is not
returned from the URLConnection, getContentType returns
"application/octet-stream" as the content type.