maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r659539 - /maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java
Date Fri, 23 May 2008 13:42:30 GMT
Author: ltheussl
Date: Fri May 23 06:42:30 2008
New Revision: 659539

URL: http://svn.apache.org/viewvc?rev=659539&view=rev
Log:
Forward isExternalLink() to DoxiaUtils to avoid code duplication.

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java?rev=659539&r1=659538&r2=659539&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java
Fri May 23 06:42:30 2008
@@ -19,7 +19,7 @@
  * under the License.
  */
 
-import java.util.Locale;
+import org.apache.maven.doxia.util.DoxiaUtils;
 
 /**
  * A collection of utility methods for dealing with APT documents.
@@ -55,13 +55,11 @@
     /**
      * Checks if the given string corresponds to an external URI,
      * ie is not a link within the same document nor a link to another
-     * document on the same filesystem.
+     * document within the same site. This forwards to
+     * {@link org.apache.maven.doxia.util.DoxiaUtils#isExternalLink(String)}.
      *
      * @param link The link to check.
-     * @return True if the link (ignoring case) starts with either "http:/",
-     * "https:/", "ftp:/", "mailto:", "file:/", or contains the string "://".
-     * Note that Windows style separators "\" are not allowed
-     * for URIs, see  http://www.ietf.org/rfc/rfc2396.txt , section 2.4.3.
+     * @return True if DoxiaUtils.isExternalLink(link) returns true.
      *
      * @see org.apache.maven.doxia.util.DoxiaUtils#isExternalLink(String)
      * @see #isInternalLink(String)
@@ -69,11 +67,7 @@
      */
     public static boolean isExternalLink( String link )
     {
-        String text = link.toLowerCase( Locale.ENGLISH );
-
-        return ( text.indexOf( "http:/" ) == 0 || text.indexOf( "https:/" ) == 0
-            || text.indexOf( "ftp:/" ) == 0 || text.indexOf( "mailto:" ) == 0
-            || text.indexOf( "file:/" ) == 0 || text.indexOf( "://" ) != -1 );
+        return DoxiaUtils.isExternalLink( link );
     }
 
     /**



Mime
View raw message