Package lumis.portal.urlshortener
Class CustomURLShortener
- java.lang.Object
-
- lumis.portal.urlshortener.CustomURLShortener
-
- All Implemented Interfaces:
IURLShortener
public class CustomURLShortener extends java.lang.Object
Custom URL shortener. This shortener uses a parametermap
to create the API URL to be used by theAbstractURLShortener
.- Since:
- 6.1.0
- Version:
- $Revision: 13752 $ $Date: 2011-10-13 14:10:51 -0300 (Thu, 13 Oct 2011) $
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PARAMETER_URL
This is the URL parameter to be used in API URLs.static java.lang.String
PARAMETER_URL_PROPERTY_KEY
-
Constructor Summary
Constructors Constructor Description CustomURLShortener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
expand(java.lang.String url)
Expands the given URL.protected java.lang.String
getApiURL()
Returns the URL shortener API URL to be used.java.lang.String
getCustomUrl()
Returns the custom URL set on this shortener.java.util.Map<java.lang.String,java.lang.String>
getParameters()
Returns the parameter map associated with this shortener.java.lang.String
shorten(java.lang.String url)
Shortens a given URL.
-
-
-
Field Detail
-
PARAMETER_URL_PROPERTY_KEY
public static final java.lang.String PARAMETER_URL_PROPERTY_KEY
- See Also:
- Constant Field Values
-
PARAMETER_URL
public static final java.lang.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
-
-
Method Detail
-
getParameters
public java.util.Map<java.lang.String,java.lang.String> getParameters()
Returns the parameter map associated with this shortener.- Returns:
- the parameter map associated with this shortener.
- Since:
- 6.1.0
-
getApiURL
protected java.lang.String getApiURL() throws PortalException
Returns the URL shortener API URL to be used.- Returns:
- Throws:
PortalException
-
getCustomUrl
public java.lang.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 java.lang.String expand(java.lang.String url) throws PortalException
Expands the given URL.- Parameters:
url
- the URL to be expanded.- Returns:
- the expanded URL.
- Throws:
PortalException
-
shorten
public java.lang.String shorten(java.lang.String url) throws PortalException
Description copied from interface:IURLShortener
Shortens a given URL.- Specified by:
shorten
in interfaceIURLShortener
- Parameters:
url
- the URL to be shortened.- Returns:
- the shortened URL.
- Throws:
PortalException
- if some error occur in shortening process.
-
-