Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

Copyright © 2006 Sun Microsystems, Inc. All rights reserved.

JSR-927 (Maintenance Release)

javax.media
Class MediaLocator

java.lang.Object
  extended byjavax.media.MediaLocator

public class MediaLocator
extends java.lang.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.

See Also:
URL, URLStreamHandler

Constructor Summary
MediaLocator(java.lang.String locatorString)
           
MediaLocator(java.net.URL url)
           
 
Method Summary
 java.lang.String getProtocol()
          Get the beginning of the locator string up to but not including the first colon.
 java.lang.String getRemainder()
          Get the MediaLocator string with the protocol removed.
 java.net.URL getURL()
          Get the URL associated with this MediaLocator.
 java.lang.String toExternalForm()
          Create a string from the URL argument that can be used to construct the MediaLocator.
 java.lang.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(java.net.URL url)
Parameters:
url - The URL to construct this media locator from.

MediaLocator

public MediaLocator(java.lang.String locatorString)
Method Detail

getURL

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

Throws:
java.net.MalformedURLException

getProtocol

public java.lang.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 java.lang.String getRemainder()
Get the MediaLocator string with the protocol removed.

Returns:
The argument string.

toString

public java.lang.String toString()
Used for printing MediaLocators.

Returns:
A string for printing MediaLocators.

toExternalForm

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

Returns:
A string for the MediaLocator.

JSR-927 (Maintenance Release)

Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

For more information, please consult the JSR 927 specification.