public String getUrl ( String htmlLink ) { String result = htmlLink ; if ( htmlLink != null ) { Matcher linkMatcher = LINKPATTERN . matcher ( htmlLink ) ; Matcher imgMatcher = IMAGEPATTERN . matcher ( htmlLink ) ; if ( linkMatcher . matches ( ) ) { String href = linkMatcher . group ( 2 ) ; href = StringEscapeUtils . unescapeHtml4 ( href ) ; result = href + linkMatcher . group ( 4 ) ; } else if ( imgMatcher . matches ( ) ) { String src = imgMatcher . group ( 2 ) ; result = StringEscapeUtils . unescapeHtml4 ( src ) ; } } return result ; }
Gets a URL from a wiki page value .