package org.apache.maven.scm.provider; import java.util.ArrayList; import java.util.List; /** * A utility class that validates and parses scm url:s. The code here is * not scm provider specific. *

* If you need methods that work for a specific scm provider, please create a * similar class for that provider. E.g. create the class CvsScmUrlUtils if * you need cvs specific checking/parsing. */ public abstract class ScmUrlUtils { /** * Validate that the scm url is in the correct format. *

* Note: does not validate scm provider specific format. * * @param scmUrl The scm url to validate * @return true if the scm url is in the correct format, * otherwise false */ public static boolean isValid( String scmUrl ) { return true; } /** * Validate that the scm url is in the correct format. *

* Note: does not validate scm provider specific format. * * @param scmUrl The scm url to validate * @return A List that contains the errors that occured * @todo Do we want this method or the next one? */ public static List validate( String scmUrl ) { return new ArrayList(); } /** * Validate that the scm url is in the correct format. *

* Note: does not validate scm provider specific format. * * @param scmUrl The scm url to validate * @throws IllegalArgumentException if there is something wrong with the * format of the scm url * @todo Do we want this method or the previous one? */ public static void validate( String scmUrl ) throws IllegalArgumentException { return; } /** * Get the separator used in the scm url. * * @param scmUrl The scm url to parse * @return The separator used in the scm url * @todo Should it return a String or a char? */ public static String getSeparator( String scmUrl ) { return ":"; } /** * Split an scm url into parts. *

* Note: does not split the scm provider specific part. * * @param scmUrl The scm url to split * @return An array with 3 components: "scm" */ public static String[] split( String scmUrl ) { return new String[0]; } /** * Split an scm url into parts, using the supplied separator. *

* Note: does not split the scm provider specific part. * * @param scmUrl The scm url to split * @param separator The separator to use when splitting the scm url * @return An array with 3 components: "scm" * @todo Should separator be a String or a char? */ public static String[] split( String scmUrl, String separator ) { return new String[0]; } }