org.ogf.saga.url
Interface URL

All Superinterfaces:
Cloneable, SagaObject

public interface URL
extends SagaObject

The URL interface provides methods to access or set the individual parts of an URL, and to convert strings to URLs and vice versa.


Field Summary
 
Fields inherited from interface org.ogf.saga.SagaObject
NO_WAIT, WAIT_FOREVER
 
Method Summary
 String getEscaped()
          Returns this URL as a string, with escapes added where needed to parse the result as an URL.
 String getFragment()
          Returns the fragment part of this URL.
 String getHost()
          Returns the host part of this URL.
 String getPath()
          Returns the path part of this URL.
 int getPort()
          Returns the port number of this URL.
 String getQuery()
          Returns the query part from this URL.
 String getScheme()
          Returns the scheme part from this URL.
 String getString()
          Returns this URL as a string.
 String getUserInfo()
          Returns the userinfo part from this URL.
 boolean isAbsolute()
          See URI.
 URL normalize()
          See URI.
 URL resolve(URL url)
          See URI.
 void setFragment()
          Sets the fragment part of this URL to "".
 void setFragment(String fragment)
          Sets the fragment part of this URL to the specified parameter.
 void setHost()
          Sets the host part of this URL to "".
 void setHost(String host)
          Sets the host part of this URL to the specified parameter.
 void setPath()
          Sets the path part of this URL to "".
 void setPath(String path)
          Sets the path part of this URL to the specified parameter.
 void setPort()
          Sets the port number of this URL to -1.
 void setPort(int port)
          Sets the port number of this URL to the specified parameter.
 void setQuery()
          Sets the query part of this URL to "".
 void setQuery(String query)
          Sets the query part of this URL to the specified parameter.
 void setScheme()
          Sets the scheme part of this URL to the specified parameter.
 void setScheme(String scheme)
          Sets the scheme part of this URL to the specified parameter.
 void setString()
          Replaces the current value of the URL with "".
 void setString(String url)
          Replaces the current value of the URL with the specified value.
 void setUserInfo()
          Sets the user info part of this URL to "".
 void setUserInfo(String userInfo)
          Sets the user info part of this URL to the specified parameter.
 URL translate(Session session, String scheme)
          Returns a new URL with the scheme part replaced.
 URL translate(String scheme)
          Returns a new URL with the scheme part replaced.
 
Methods inherited from interface org.ogf.saga.SagaObject
clone, getId, getSession
 

Method Detail

setString

void setString(String url)
               throws BadParameterException
Replaces the current value of the URL with the specified value.

Parameters:
url - the string.
Throws:
BadParameterException - is thrown when there is a syntax error in the parameter.

setString

void setString()
               throws BadParameterException
Replaces the current value of the URL with "".

Throws:
BadParameterException - is thrown by setString(String).

getString

String getString()
Returns this URL as a string. The result may contain non-escaped characters, so may not be suitable for creating a new URL object. For that, you have to use getEscaped().

Returns:
the string.

getEscaped

String getEscaped()
Returns this URL as a string, with escapes added where needed to parse the result as an URL.

Returns:
the string.

getFragment

String getFragment()
Returns the fragment part of this URL.

Returns:
the fragment.

setFragment

void setFragment(String fragment)
                 throws BadParameterException
Sets the fragment part of this URL to the specified parameter.

Parameters:
fragment - the fragment.
Throws:
BadParameterException - is thrown when there is a syntax error in the parameter.

setFragment

void setFragment()
                 throws BadParameterException
Sets the fragment part of this URL to "".

Throws:
BadParameterException - is thrown by setFragment(String).

getHost

String getHost()
Returns the host part of this URL.

Returns:
the host.

setHost

void setHost(String host)
             throws BadParameterException
Sets the host part of this URL to the specified parameter.

Parameters:
host - the host.
Throws:
BadParameterException - is thrown when there is a syntax error in the parameter.

setHost

void setHost()
             throws BadParameterException
Sets the host part of this URL to "".

Throws:
BadParameterException - is thrown by setHost(String).

getPath

String getPath()
Returns the path part of this URL.

Returns:
the path.

setPath

void setPath(String path)
             throws BadParameterException
Sets the path part of this URL to the specified parameter.

Parameters:
path - the path.
Throws:
BadParameterException - is thrown when there is a syntax error in the path.

setPath

void setPath()
             throws BadParameterException
Sets the path part of this URL to "".

Throws:
BadParameterException - is thrown by setPath(String).

getPort

int getPort()
Returns the port number of this URL.

Returns:
the port number.

setPort

void setPort(int port)
             throws BadParameterException
Sets the port number of this URL to the specified parameter.

Parameters:
port - the port number.
Throws:
BadParameterException - is thrown when there is an error in the parameter.

setPort

void setPort()
             throws BadParameterException
Sets the port number of this URL to -1.

Throws:
BadParameterException - is thrown by setPort().

getQuery

String getQuery()
Returns the query part from this URL.

Returns:
the query.

setQuery

void setQuery(String query)
              throws BadParameterException
Sets the query part of this URL to the specified parameter.

Parameters:
query - the query.
Throws:
BadParameterException - is thrown when there is a syntax error in the parameter.

setQuery

void setQuery()
              throws BadParameterException
Sets the query part of this URL to "".

Throws:
BadParameterException - is thrown by setQuery(String).

getScheme

String getScheme()
Returns the scheme part from this URL.

Returns:
the scheme.

setScheme

void setScheme(String scheme)
               throws BadParameterException
Sets the scheme part of this URL to the specified parameter.

Parameters:
scheme - the scheme.
Throws:
BadParameterException - is thrown when there is a syntax error in the parameter.

setScheme

void setScheme()
               throws BadParameterException
Sets the scheme part of this URL to the specified parameter.

Throws:
BadParameterException - is thrown by setScheme(String).

getUserInfo

String getUserInfo()
Returns the userinfo part from this URL.

Returns:
the userinfo.

setUserInfo

void setUserInfo(String userInfo)
                 throws BadParameterException
Sets the user info part of this URL to the specified parameter.

Parameters:
userInfo - the userinfo.
Throws:
BadParameterException - is thrown when there is a syntax error in the parameter.

setUserInfo

void setUserInfo()
                 throws BadParameterException
Sets the user info part of this URL to "".

Throws:
BadParameterException - is thrown by setUserInfo(String).

translate

URL translate(String scheme)
              throws BadParameterException,
                     NoSuccessException
Returns a new URL with the scheme part replaced.

Parameters:
scheme - the new scheme.
Returns:
the new URL.
Throws:
BadParameterException - is thrown when there is a syntax error in the new URL.
NoSuccessException - is thrown when the scheme is supported, but the URL cannot be translated to the scheme.

translate

URL translate(Session session,
              String scheme)
              throws BadParameterException,
                     NoSuccessException
Returns a new URL with the scheme part replaced.

Parameters:
session - session to be used for possibly-needed back-end communication.
scheme - the new scheme.
Returns:
the new URL.
Throws:
BadParameterException - is thrown when there is a syntax error in the new URL.
NoSuccessException - is thrown when the scheme is supported, but the URL cannot be translated to the scheme.

resolve

URL resolve(URL url)
            throws NoSuccessException
See URI.

Parameters:
url - the url to resolve with respect to this one.
Returns:
the resolved url.
Throws:
NoSuccessException - is thrown when resolving fails for some reason.

isAbsolute

boolean isAbsolute()
See URI.

Returns:
whether this URL is an absolute URL.

normalize

URL normalize()
See URI.

Returns:
a normalized URL.


Copyright © 2014 Open Grid Forum. All rights reserved.