Methods Summary |
---|
public java.lang.String | 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.
String type = null;
try {
if (url_conn == null)
url_conn = url.openConnection();
} catch (IOException e) { }
if (url_conn != null)
type = url_conn.getContentType();
if (type == null)
type = "application/octet-stream";
return type;
|
public java.io.InputStream | getInputStream()The getInputStream method from the URL. Calls the
openStream method on the URL.
return url.openStream();
|
public java.lang.String | getName()Calls the getFile method on the URL used to
instantiate the object.
return url.getFile();
|
public java.io.OutputStream | getOutputStream()The getOutputStream method from the URL. First an attempt is
made to get the URLConnection object for the URL. If that
succeeds, the getOutputStream method on the URLConnection
is returned.
// get the url connection if it is available
url_conn = url.openConnection();
if (url_conn != null) {
url_conn.setDoOutput(true);
return url_conn.getOutputStream();
} else
return null;
|
public java.net.URL | getURL()Return the URL used to create this DataSource.
return url;
|