public class MediaLocator extends Object
MediaLocator
describes the location of
media content. MediaLocator
is closely
related to URL
. URLs
can be obtained from MediaLocators
, and
MediaLocators
can be constructed from
URL
.
Unlike a URL
, a MediaLocator
can be instanced without a URLStreamHandler
installed on the System.URL
,
URLStreamHandler
Constructor and Description |
---|
MediaLocator(String locatorString) |
MediaLocator(URL url) |
Modifier and Type | Method and Description |
---|---|
String |
getProtocol()
Get the beginning of the locator string
up to but not including the first colon.
|
String |
getRemainder()
Get the
MediaLocator string with the protocol removed. |
URL |
getURL()
Get the
URL associated with this MediaLocator . |
String |
toExternalForm()
Create a string from the
URL argument that can
be used to construct the MediaLocator . |
String |
toString()
Used for printing
MediaLocators . |
public MediaLocator(URL url)
url
- The URL
to construct this media locator from.public MediaLocator(String locatorString)
public URL getURL() throws MalformedURLException
URL
associated with this MediaLocator
.MalformedURLException
public String getProtocol()
MediaLocator
.public String getRemainder()
MediaLocator
string with the protocol removed.public String toString()
MediaLocators
.public String toExternalForm()
URL
argument that can
be used to construct the MediaLocator
.MediaLocator
.Copyright © 2013 CableLabs. All rights reserved.