You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2006/02/10 09:07:08 UTC

svn commit: r376589 - /maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java

Author: ltheussl
Date: Fri Feb 10 00:07:04 2006
New Revision: 376589

URL: http://svn.apache.org/viewcvs?rev=376589&view=rev
Log:
Remove unused methods, fix separator character

Modified:
    maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java

Modified: maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java?rev=376589&r1=376588&r2=376589&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java (original)
+++ maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java Fri Feb 10 00:07:04 2006
@@ -50,83 +50,8 @@
     }
 
     /**
-     * Get cvs root.
-     *
-     * @param scmConnection the scm connection to analyse.
-     * @return CVS root.
-     */
-    public String getCvsRoot( String scmConnection )
-    {
-        if ( isValid( scmConnection ) )
-        {
-            return getCvsRoot( scmConnection, "" );
-        }
-
-        return null;
-    }
-
-    /**
-     * Get cvs server. Used in
-     * xdocs/src/plugin-resources/templates/cvs-usage.xml.
-     *
-     * @param conn six token connection string
-     * @return CVS module.
-     */
-    public String getCvsServer( String conn )
-    {
-        String[] tokens = splitSCMConnection( conn );
-
-        if ( !tokens[1].equals( "cvs" ) )
-        {
-            return "";
-        }
-
-        if ( tokens[3].indexOf( '@' ) >= 0 )
-        {
-            return tokens[3].substring( tokens[3].indexOf( '@' ) + 1 );
-        }
-        else
-        {
-            return tokens[3];
-        }
-    }
-
-    /**
-     * Get cvs root. Used in xdocs/src/plugin-resources/templates/cvs-usage.xml.
-     *
-     * @param conn six token connection string
-     * @param username username override if non-empty.
-     * @return CVS root.
-     */
-    public String getCvsRoot( String conn, String username )
-    {
-        String[] tokens = splitSCMConnection( conn );
-
-        if ( !tokens[1].equals( "cvs" ) )
-        {
-            return "";
-        }
-
-        if ( tokens[3].indexOf( '@' ) >= 0 )
-        {
-            if ( username.length() == 0 )
-            {
-                username = tokens[3].substring( 0, tokens[3].indexOf( '@' ) );
-            }
-
-            tokens[3] =
-                username + "@"
-                + tokens[3].substring( tokens[3].indexOf( '@' ) + 1 );
-        }
-
-        String result = ":" + tokens[2] + ":" + tokens[3] + ":" + tokens[4];
-
-        return result;
-    }
-
-    /**
      * Get cvs connection string.
-     * Used in xdocs/src/plugin-resources/templates/cvs-usage.xml.
+     * Used in xdocs/src/plugin-resources/templates/scm/cvs.xml.
      * If username == "", assumes anonymous (pserver) connection. In this case,
      * inserts a separator (':' or '|') between the username and '@' to indicate
      * that there is a password and that it is empty.
@@ -145,9 +70,7 @@
             return "";
         }
 
-        // The length of conn has already been checked in the call to
-        // splitSCMConnection(conn) above, so it's OK to just extract the char.
-        String separator = "" + conn.charAt( 3 );
+        String separator = getSCMConnectionSeparator( conn );
 
         if ( tokens[3].indexOf( '@' ) >= 0 )
         {
@@ -164,7 +87,7 @@
         }
 
         String result =
-            tokens[0] + separator + tokens[1] + separator + tokens[2]
+            tokens[0] + ":" + tokens[1] + separator + tokens[2]
             + separator + tokens[3] + separator + tokens[4] + separator
             + tokens[5];
 
@@ -173,7 +96,7 @@
 
     /**
      * Get cvs module. Used in
-     * xdocs/src/plugin-resources/templates/cvs-usage.xml.
+     * xdocs/src/plugin-resources/templates/scm/cvs.xml.
      *
      * @param conn six token connection string
      * @return CVS module.