|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.File
com.sun.dtv.broadcast.BroadcastStream
public class BroadcastStream
The BroadcastStream
class represents
stream obtained from broadcast file systems. An
instance of BroadcastStream
may be constructed from a
Locator
instance or via constructors similar to those
of java.io.File
. This also means that all these constructors
use the same characters for name and path separation as other files.
On the other hand the locator based constructor uses locators possibly
created from URLs following the usual URL based schema where path names
are separated by '/'.
Successful instantiation of a BroadcastStream
object
causes its broadcast stream to be dynamically "mounted" in the
local filesystem. The precise mount point can be determined by
calling getBroadcastFilesystem()
.
It should be noted that a broadcast filesystem can also be explicitly
mounted using instances of BroadcastFilesystem
.
Construction of a BroadcastStream
object does not
cause its contents to be loaded automatically from the broadcast stream.
Content will be only be loaded when a FileInputStream will be created
from this BroadcastStream
.
Subsequent attempts to read the data of a BroadcastStream
object will then block until its contents are loaded.
All constructors and subsequent input or output operations must use BroadcastException to throw broadcast specific exceptions.
Broadcast file systems for which there are no remaining
BroadcastStream
instances or open file descriptors are
eligible for unmounting from the local filesystem.
Java DTV API implementations that do not support broadcast
filesystem access will throw UnsupportedOperationException
upon any attempt
to construct a BroadcastStream
object.
Field Summary |
---|
Fields inherited from class java.io.File |
---|
pathSeparator, pathSeparatorChar, separator, separatorChar |
Constructor Summary | |
---|---|
BroadcastStream(File dir,
String name)
Creates a BroadcastStream instance that represents the
stream with the specified name in the specified broadcast directory. |
|
BroadcastStream(Locator locator)
Creates a BroadcastStream instance that represents the file
referenced by the given Locator . |
|
BroadcastStream(String path)
Creates a BroadcastStream instance that represents the
stream whose path name in the broadcast is the given path argument. |
|
BroadcastStream(String path,
String name)
Creates a BroadcastStream instance that represents the
stream with the specified name in the specified broadcast directory. |
Method Summary | |
---|---|
BroadcastFilesystem |
getBroadcastFilesystem()
Returns the BroadcastFileSystem this
BroadcastStream belongs to. |
long |
getCurrentTime()
Returns the time of the next chunk in BroadcastStream . |
long |
getDuration()
Returns the duration of this BroadcastStream . |
Locator |
getLocator()
Returns a Locator identifying this
BroadcastStream . |
String |
getType()
Retrieve the mime type of a BroadcastStream. |
Methods inherited from class java.io.File |
---|
canRead, canWrite, compareTo, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BroadcastStream(Locator locator) throws InvalidLocatorException, IOException
BroadcastStream
instance that represents the file
referenced by the given Locator
.
This constructor throws java.io.IOException
if it
determines immediately that the requested broadcast stream cannot
be accessed. Since this constructor may complete its work
asynchronously, absence of an IOException
is not a
guarantee that the requested broadcast stream is accessible.
locator
- A Locator
referencing the source of the
BroadcastStream
.
InvalidLocatorException
- If locator
does not
refer to a broadcast stream.
IOException
- If the requested broadcast stream cannot be
accessed or the received data is invalid.
UnsupportedOperationException
- If broadcast filesystem is not supported.public BroadcastStream(String path) throws IOException
BroadcastStream
instance that represents the
stream whose path name in the broadcast is the given path argument.
This constructor throws java.io.IOException
if it
determines immediately that the requested broadcast stream cannot
be accessed. Since this constructor may complete its work
asynchronously, absence of an IOException
is not a
guarantee that the requested broadcast stream is accessible.
path
- The stream path name.
IOException
- If the requested broadcast stream cannot be
accessed or the received data is invalid.
UnsupportedOperationException
- If broadcast filesystem is not supported.public BroadcastStream(File dir, String name) throws IOException
BroadcastStream
instance that represents the
stream with the specified name in the specified broadcast directory.
This constructor throws java.io.IOException
if it
determines immediately that the requested broadcast stream cannot
be accessed. Since this constructor may complete its work
asynchronously, absence of an IOException
is not a
guarantee that the requested broadcast stream is accessible.
dir
- The directory.name
- The stream name.
IOException
- If the requested broadcast stream cannot be
accessed or the received data is invalid.
UnsupportedOperationException
- If broadcast filesystem is not supported.public BroadcastStream(String path, String name) throws IOException
BroadcastStream
instance that represents the
stream with the specified name in the specified broadcast directory.
This constructor throws java.io.IOException
if it
determines immediately that the requested broadcast stream cannot
be accessed. Since this constructor may complete its work
asynchronously, absence of an IOException
is not a
guarantee that the requested broadcast stream is accessible.
path
- The directory path name.name
- The stream name.
IOException
- If the requested broadcast stream cannot be
accessed or the received data is invalid.
UnsupportedOperationException
- If broadcast filesystem is not supported.Method Detail |
---|
public String getType()
public long getDuration()
BroadcastStream
.
public long getCurrentTime()
BroadcastStream
.
public BroadcastFilesystem getBroadcastFilesystem()
BroadcastFileSystem
this
BroadcastStream
belongs to.
BroadcastFilesystem
this
BroadcastStream
belongs to.public Locator getLocator()
Locator
identifying this
BroadcastStream
.
Locator
identifying this
BroadcastStream
.
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |