lumis.portal.urlshortener
Class CustomURLShortener

Package class diagram package CustomURLShortener
java.lang.Object
  extended by lumis.portal.urlshortener.CustomURLShortener
All Implemented Interfaces:
IURLShortener

public class CustomURLShortener
extends Object

Custom URL shortener. This shortener uses a parameter map to create the API URL to be used by the AbstractURLShortener.

Since:
6.1.0

Field Summary
static String PARAMETER_URL
          This is the URL parameter to be used in API URLs.
static String PARAMETER_URL_PROPERTY_KEY
           
 
Constructor Summary
CustomURLShortener()
           
 
Method Summary
 String expand(String url)
          Expands the given URL.
protected  String getApiURL()
          Returns the URL shortener API URL to be used.
 String getCustomUrl()
          Returns the custom URL set on this shortener.
 Map<String,String> getParameters()
          Returns the parameter map associated with this shortener.
 String shorten(String url)
          Shortens a given URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_URL_PROPERTY_KEY

public static final String PARAMETER_URL_PROPERTY_KEY
See Also:
Constant Field Values

PARAMETER_URL

public static final String PARAMETER_URL
This is the URL parameter to be used in API URLs. This parameter will be replaced by the URL to be shortened.

Since:
6.1.0
See Also:
Constant Field Values
Constructor Detail

CustomURLShortener

public CustomURLShortener()
Method Detail

getParameters

public Map<String,String> getParameters()
Returns the parameter map associated with this shortener.

Returns:
the parameter map associated with this shortener.
Since:
6.1.0

getApiURL

protected String getApiURL()
                    throws PortalException
Returns the URL shortener API URL to be used.

Returns:
Throws:
PortalException

getCustomUrl

public String getCustomUrl()
                    throws PortalException
Returns the custom URL set on this shortener.

Returns:
the custom URL set on this shortener.
Throws:
PortalException
Since:
6.1.0

expand

public String expand(String url)
              throws PortalException
Expands the given URL.

Parameters:
url - the URL to be expanded.
Returns:
the expanded URL.
Throws:
PortalException

shorten

public String shorten(String url)
               throws PortalException
Description copied from interface: IURLShortener
Shortens a given URL.

Specified by:
shorten in interface IURLShortener
Parameters:
url - the URL to be shortened.
Returns:
the shortened URL.
Throws:
PortalException - if some error occur in shortening process.


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.