public class URLDataSource extends PullDataSource
URL using URLConnection.| Modifier and Type | Field and Description |
|---|---|
protected URLConnection |
conn |
protected boolean |
connected |
protected ContentDescriptor |
contentType |
DURATION_UNBOUNDED, DURATION_UNKNOWN| Modifier | Constructor and Description |
|---|---|
protected |
URLDataSource()
Implemented by subclasses.
|
|
URLDataSource(URL url)
Construct a
URLDataSource
directly from a URL. |
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Initialize the connection with the source.
|
void |
disconnect()
Disconnect the source.
|
String |
getContentType()
Return the content type name.
|
Object |
getControl(String controlName)
Returns null, because this source doesn't provide
any controls.
|
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
|
getLocator, initCheck, setLocatorprotected URLConnection conn
protected ContentDescriptor contentType
protected boolean connected
protected URLDataSource()
public URLDataSource(URL url) throws IOException
URLDataSource
directly from a URL.IOExceptionpublic PullSourceStream[] getStreams()
PullDataSourceDataSource provides the only indication of
what streams can be available on this connection.getStreams in class PullDataSourcepublic void connect()
throws IOException
connect in class DataSourceIOException - Thrown if there are problems setting
up the connection.public String getContentType()
getContentType in class DataSourcepublic void disconnect()
disconnect in class DataSourcepublic void start()
throws IOException
DataSourcestart method must be
called before data is available.
(You must call connect before calling start.)start in class DataSourceIOException - Thrown if there are IO problems with the source
when start is called.public void stop()
throws IOException
stop in class DataSourceIOExceptionpublic Time getDuration()
Duration.DURATION_UNKNOWN.
The duration is not available from an InputStream.Duration.DURATION_UNKNOWN.public Object[] getControls()
Object array.Copyright © 2012 code4tv.com. All Rights Reserved.