站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.6 API 英文版文档

URLTools - JBOSS Portal 2.6 API 英文版文档


org.jboss.portal.common.util
Class URLTools

java.lang.Object
  extended byorg.jboss.portal.common.util.URLTools

public class URLTools
extends java.lang.Object

Since:
2.4 (May 26, 2006)
Version:
$Revision: 5451 $
Author:
Chris Laprun

Nested Class Summary
static class URLTools.URLMatch
           
static class URLTools.URLReplacementGenerator
           
 
Field Summary
static java.lang.String FILE_PREFIX
           
static java.lang.String HTTP_PREFIX
           
static java.lang.String HTTPS_PREFIX
           
private static java.util.regex.Pattern LINK
           
static java.lang.String RE_EMAIL_VALIDATION
           
 
Constructor Summary
URLTools()
           
 
Method Summary
static java.lang.String decodeXWWWFormURL(java.lang.String s)
           
static java.lang.String encodeXWWWFormURL(java.lang.String s)
           
static void enforceAbsoluteURL(java.lang.String url)
          Enforces that the given URL is absolute
static boolean exists(java.net.URL url)
           
static URLTools.URLMatch[] extractURLsFrom(java.lang.String markup)
           
static int getURLCountIn(java.lang.String markup)
           
static boolean isEmailValid(java.lang.String address)
          Return true is the address is not null and matches the email validation regular expression.
static boolean isURLAbsolute(java.lang.String url)
           
static java.lang.String replaceURLsBy(java.lang.String markup, java.lang.String[] replacements)
           
static java.lang.String replaceURLsBy(java.lang.String markup, URLTools.URLReplacementGenerator generator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RE_EMAIL_VALIDATION

public static final java.lang.String RE_EMAIL_VALIDATION
See Also:
Constant Field Values

LINK

private static final java.util.regex.Pattern LINK

HTTP_PREFIX

public static final java.lang.String HTTP_PREFIX
See Also:
Constant Field Values

HTTPS_PREFIX

public static final java.lang.String HTTPS_PREFIX
See Also:
Constant Field Values

FILE_PREFIX

public static final java.lang.String FILE_PREFIX
See Also:
Constant Field Values
Constructor Detail

URLTools

public URLTools()
Method Detail

isURLAbsolute

public static boolean isURLAbsolute(java.lang.String url)

enforceAbsoluteURL

public static void enforceAbsoluteURL(java.lang.String url)
                               throws java.lang.IllegalArgumentException
Enforces that the given URL is absolute

Parameters:
url - the String representation of the URL to be checked
Throws:
java.lang.IllegalArgumentException - if the given URL is not absolute

encodeXWWWFormURL

public static java.lang.String encodeXWWWFormURL(java.lang.String s)

decodeXWWWFormURL

public static java.lang.String decodeXWWWFormURL(java.lang.String s)

isEmailValid

public static boolean isEmailValid(java.lang.String address)
Return true is the address is not null and matches the email validation regular expression.


exists

public static boolean exists(java.net.URL url)

extractURLsFrom

public static URLTools.URLMatch[] extractURLsFrom(java.lang.String markup)

getURLCountIn

public static int getURLCountIn(java.lang.String markup)

replaceURLsBy

public static java.lang.String replaceURLsBy(java.lang.String markup,
                                             java.lang.String[] replacements)

replaceURLsBy

public static java.lang.String replaceURLsBy(java.lang.String markup,
                                             URLTools.URLReplacementGenerator generator)