net.sf.fmj.media.protocol
Class URLDataSource

java.lang.Object
  extended by javax.media.protocol.DataSource
      extended by javax.media.protocol.PullDataSource
          extended by net.sf.fmj.media.protocol.URLDataSource
All Implemented Interfaces:
Controls, Duration, SourceCloneable
Direct Known Subclasses:
DataSource, URLDataSource

public class URLDataSource
extends PullDataSource
implements SourceCloneable

URL DataSource. Used by default when there is no more specific protocol handler available.

Author:
Ken Larson

Field Summary
protected  java.net.URLConnection conn
           
protected  boolean connected
           
protected  net.sf.fmj.media.protocol.URLDataSource.URLSourceStream[] sources
           
 
Fields inherited from interface javax.media.Duration
DURATION_UNBOUNDED, DURATION_UNKNOWN
 
Constructor Summary
protected URLDataSource()
           
  URLDataSource(java.net.URL url)
           
 
Method Summary
 void connect()
           
 DataSource createClone()
          Based on JMF testing, the clone is in the same state as the original (opened and connected if the original is), but at the beginning of the media, not whatever position the original is.
 void disconnect()
           
 java.lang.String getContentType()
           
 java.lang.Object getControl(java.lang.String controlName)
           
 java.lang.Object[] getControls()
           
 Time getDuration()
           
 PullSourceStream[] getStreams()
           
 void start()
           
 void stop()
           
 
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

conn

protected java.net.URLConnection conn

connected

protected boolean connected

sources

protected net.sf.fmj.media.protocol.URLDataSource.URLSourceStream[] sources
Constructor Detail

URLDataSource

protected URLDataSource()

URLDataSource

public URLDataSource(java.net.URL url)
Method Detail

createClone

public DataSource createClone()
Description copied from interface: SourceCloneable
Based on JMF testing, the clone is in the same state as the original (opened and connected if the original is), but at the beginning of the media, not whatever position the original is.

Specified by:
createClone in interface SourceCloneable

getStreams

public PullSourceStream[] getStreams()
Specified by:
getStreams in class PullDataSource

connect

public void connect()
             throws java.io.IOException
Specified by:
connect in class DataSource
Throws:
java.io.IOException

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in class DataSource

disconnect

public void disconnect()
Specified by:
disconnect in class DataSource

start

public void start()
           throws java.io.IOException
Specified by:
start in class DataSource
Throws:
java.io.IOException

stop

public void stop()
          throws java.io.IOException
Specified by:
stop in class DataSource
Throws:
java.io.IOException

getDuration

public Time getDuration()
Specified by:
getDuration in interface Duration
Specified by:
getDuration in class DataSource

getControls

public java.lang.Object[] getControls()
Specified by:
getControls in interface Controls
Specified by:
getControls in class DataSource

getControl

public java.lang.Object getControl(java.lang.String controlName)
Specified by:
getControl in interface Controls
Specified by:
getControl in class DataSource