|
JSR-927 (Maintenance Release) | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.media.protocol.DataSource javax.media.protocol.PullDataSource javax.media.protocol.URLDataSource
A default data-source created directly from
a URL
using URLConnection
.
URL
,
URLConnection
,
InputSourceStream
Field Summary | |
protected java.net.URLConnection |
conn
|
protected boolean |
connected
|
protected ContentDescriptor |
contentType
|
Fields inherited from interface javax.media.Duration |
DURATION_UNBOUNDED, DURATION_UNKNOWN |
Constructor Summary | |
protected |
URLDataSource()
Implemented by subclasses. |
|
URLDataSource(java.net.URL url)
Construct a URLDataSource
directly from a URL . |
Method Summary | |
void |
connect()
Initialize the connection with the source. |
void |
disconnect()
Disconnect the source. |
java.lang.String |
getContentType()
Return the content type name. |
java.lang.Object |
getControl(java.lang.String controlName)
Returns null, because this source doesn't provide any controls. |
java.lang.Object[] |
getControls()
Returns an empty array, because this source doesn't provide any controls. |
Time |
getDuration()
Returns Duration.DURATION_UNKNOWN . |
PullSourceStream[] |
getStreams()
Get the collection of streams that this source manages. |
void |
start()
Initiate data-transfer. |
void |
stop()
Stops the |
Methods inherited from class javax.media.protocol.DataSource |
getLocator, initCheck, setLocator |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.net.URLConnection conn
protected ContentDescriptor contentType
protected boolean connected
Constructor Detail |
protected URLDataSource()
public URLDataSource(java.net.URL url) throws java.io.IOException
URLDataSource
directly from a URL
.
Method Detail |
public PullSourceStream[] getStreams()
PullDataSource
DataSource
provides the only indication of
what streams can be available on this connection.
getStreams
in class PullDataSource
public void connect() throws java.io.IOException
connect
in class DataSource
java.io.IOException
- Thrown if there are problems setting
up the connection.public java.lang.String getContentType()
getContentType
in class DataSource
public void disconnect()
disconnect
in class DataSource
public void start() throws java.io.IOException
DataSource
start
method must be
called before data is available.
(You must call connect
before calling start
.)
start
in class DataSource
java.io.IOException
- Thrown if there are IO problems with the source
when start
is called.public void stop() throws java.io.IOException
stop
in class DataSource
java.io.IOException
public Time getDuration()
Duration.DURATION_UNKNOWN
.
The duration is not available from an InputStream
.
Duration.DURATION_UNKNOWN
.public java.lang.Object[] getControls()
Object
array.public java.lang.Object getControl(java.lang.String controlName)
null
.
|
JSR-927 (Maintenance Release) | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |