/** * Validate that the scm url is in the correct format. * <p/> * <strong>Note</strong>: does not validate scm provider specific format. * </p> * * @param scmUrl The scm url to validate * @return <code>true</code> if the scm url is in the correct format, * otherwise <code>false</code> */ public static boolean isValid( String scmUrl ) { List<String> messages = validate( scmUrl ); return messages.isEmpty(); }
/** * Validate that the scm url is in the correct format. * <p/> * <strong>Note</strong>: does not validate scm provider specific format. * </p> * * @param scmUrl The scm url to validate * @return <code>true</code> if the scm url is in the correct format, * otherwise <code>false</code> */ public static boolean isValid( String scmUrl ) { List<String> messages = validate( scmUrl ); return messages.isEmpty(); }
/** * {@inheritDoc} */ public List<String> validateScmRepository( String scmUrl ) { List<String> messages = new ArrayList<String>(); messages.addAll( ScmUrlUtils.validate( scmUrl ) ); String providerType = ScmUrlUtils.getProvider( scmUrl ); ScmProvider provider; try { provider = getProviderByType( providerType ); } catch ( NoSuchScmProviderException e ) { messages.add( "No such provider installed '" + providerType + "'." ); return messages; } String scmSpecificUrl = cleanScmUrl( scmUrl.substring( providerType.length() + 5 ) ); List<String> providerMessages = provider.validateScmUrl( scmSpecificUrl, ScmUrlUtils.getDelimiter( scmUrl ).charAt( 0 ) ); if ( providerMessages == null ) { throw new RuntimeException( "The SCM provider cannot return null from validateScmUrl()." ); } messages.addAll( providerMessages ); return messages; }
/** * {@inheritDoc} */ public List<String> validateScmRepository( String scmUrl ) { List<String> messages = new ArrayList<String>(); messages.addAll( ScmUrlUtils.validate( scmUrl ) ); String providerType = ScmUrlUtils.getProvider( scmUrl ); ScmProvider provider; try { provider = getProviderByType( providerType ); } catch ( NoSuchScmProviderException e ) { messages.add( "No such provider installed '" + providerType + "'." ); return messages; } String scmSpecificUrl = cleanScmUrl( scmUrl.substring( providerType.length() + 5 ) ); List<String> providerMessages = provider.validateScmUrl( scmSpecificUrl, ScmUrlUtils.getDelimiter( scmUrl ).charAt( 0 ) ); if ( providerMessages == null ) { throw new RuntimeException( "The SCM provider cannot return null from validateScmUrl()." ); } messages.addAll( providerMessages ); return messages; }