javax.activation

Class URLDataSource

public class URLDataSource extends Object implements DataSource

DataSource implementation that retrieves its data from a URL.
Constructor Summary
URLDataSource(URL url)
Constructor.
Method Summary
StringgetContentType()
Returns the Content-Type header for the URL.
InputStreamgetInputStream()
StringgetName()
Returns the result of getFile of the underlying URL.
OutputStreamgetOutputStream()
URLgetURL()
Returns the underlying URL.

Constructor Detail

URLDataSource

public URLDataSource(URL url)
Constructor. This will not open the connection to the URL.

Method Detail

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".

getInputStream

public InputStream getInputStream()

getName

public String getName()
Returns the result of getFile of the underlying URL.

getOutputStream

public OutputStream getOutputStream()

getURL

public URL getURL()
Returns the underlying URL.