javax.media
Class MediaLocator

java.lang.Object
  extended by javax.media.MediaLocator
Direct Known Subclasses:
MediaLocator

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.

Version:
1.8, 97/08/25.
See Also:
URL, URLStreamHandler

Constructor Summary
MediaLocator(String locatorString)
           
MediaLocator(URL url)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MediaLocator

public MediaLocator(URL url)
Parameters:
url - The URL to construct this media locator from.

MediaLocator

public MediaLocator(String locatorString)
Method Detail

getURL

public URL getURL()
           throws MalformedURLException
Get the URL associated with this MediaLocator.

Throws:
MalformedURLException

getProtocol

public String getProtocol()
Get the beginning of the locator string up to but not including the first colon.

Returns:
The protocol for this MediaLocator.

getRemainder

public String getRemainder()
Get the MediaLocator string with the protocol removed.

Returns:
The argument string.

toString

public String toString()
Used for printing MediaLocators.

Overrides:
toString in class Object
Returns:
A string for printing MediaLocators.

toExternalForm

public String toExternalForm()
Create a string from the URL argument that can be used to construct the MediaLocator.

Returns:
A string for the MediaLocator.


Copyright © 2011. All Rights Reserved.