All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.media.protocol.URLDataSource

java.lang.Object
   |
   +----javax.media.protocol.DataSource
           |
           +----javax.media.protocol.PullDataSource
                   |
                   +----javax.media.protocol.URLDataSource

public class URLDataSource
extends PullDataSource
A default data-source created directly from a URL using URLConnection.

Version:
1.19, 97/08/28.
See Also:
URL, URLConnection, InputSourceStream

Variable Index

 o conn
 o connected
 o contentType
 o sources

Constructor Index

 o URLDataSource()
Implemented by subclasses.
 o URLDataSource(URL)
Construct a URLDataSource directly from a URL.

Method Index

 o connect()
Initialize the connection with the source.
 o disconnect()
Disconnect the source.
 o getContentType()
Return the content type name.
 o getControl(String)
Returns null, because this source doesn't provide any controls.
 o getControls()
Returns an empty array, because this source doesn't provide any controls.
 o getDuration()
Returns Duration.DURATION_UNKNOWN.
 o getStreams()
Get the collection of streams that this source manages.
 o start()
Initiate data-transfer.
 o stop()
Stops the

Variables

 o conn
 protected URLConnection conn
 o contentType
 protected ContentDescriptor contentType
 o sources
 protected URLSourceStream sources[]
 o connected
 protected boolean connected

Constructors

 o URLDataSource
 protected URLDataSource()
Implemented by subclasses.

 o URLDataSource
 public URLDataSource(URL url) throws IOException
Construct a URLDataSource directly from a URL.

Methods

 o getStreams
 public PullSourceStream[] getStreams()
Get the collection of streams that this source manages.

Overrides:
getStreams in class PullDataSource
 o connect
 public void connect() throws IOException
Initialize the connection with the source.

Throws: IOException
Thrown if there are problems setting up the connection.
Overrides:
connect in class DataSource
 o getContentType
 public String getContentType()
Return the content type name.

Returns:
The content type name.
Overrides:
getContentType in class DataSource
 o disconnect
 public void disconnect()
Disconnect the source.

Overrides:
disconnect in class DataSource
 o start
 public void start() throws IOException
Initiate data-transfer.

Overrides:
start in class DataSource
 o stop
 public void stop() throws IOException
Stops the

Overrides:
stop in class DataSource
 o getDuration
 public Time getDuration()
Returns Duration.DURATION_UNKNOWN. The duration is not available from an InputStream.

Returns:
Duration.DURATION_UNKNOWN.
Overrides:
getDuration in class DataSource
 o getControls
 public Object[] getControls()
Returns an empty array, because this source doesn't provide any controls.

Returns:
empty Object array.
Overrides:
getControls in class DataSource
 o getControl
 public Object getControl(String controlName)
Returns null, because this source doesn't provide any controls.

Overrides:
getControl in class DataSource

All Packages  Class Hierarchy  This Package  Previous  Next  Index