IT. Expert System.

Java Enterprise Edition (EE)

URLDataSource


javax.activation
Class URLDataSource

java.lang.Object
  javax.activation.URLDataSource
All Implemented Interfaces:
DataSource
public class URLDataSource
extends java.lang.Object
implements DataSource

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.

See Also:
DataSource, DataHandler

Constructor Summary
URLDataSource(java.net.URL url)
          URLDataSource constructor.
 
Method Summary
 java.lang.String getContentType()
          Returns the value of the URL content-type header field.
 java.io.InputStream getInputStream()
          The getInputStream method from the URL.
 java.lang.String getName()
          Calls the getFile method on the URL used to instantiate the object.
 java.io.OutputStream getOutputStream()
          The getOutputStream method from the URL.
 java.net.URL getURL()
          Return the URL used to create this DataSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLDataSource

public URLDataSource(java.net.URL url)
URLDataSource constructor. The URLDataSource class will not open a connection to the URL until a method requiring it to do so is called.

Parameters:
url - The URL to be encapsulated in this object.
Method Detail

getContentType

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.

Specified by:
getContentType in interface DataSource
Returns:
the content type.

getName

public java.lang.String getName()
Calls the getFile method on the URL used to instantiate the object.

Specified by:
getName in interface DataSource
Returns:
the result of calling the URL's getFile method.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
The getInputStream method from the URL. Calls the openStream method on the URL.

Specified by:
getInputStream in interface DataSource
Returns:
the InputStream.
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
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.

Specified by:
getOutputStream in interface DataSource
Returns:
the OutputStream.
Throws:
java.io.IOException

getURL

public java.net.URL getURL()
Return the URL used to create this DataSource.

Returns:
The URL.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1320 / 248361926. Delta: 5.34417 с