/** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { try { ScmUrlParserResult result = parseScmUrl( scmSpecificUrl, delimiter ); if ( result.messages.size() > 0 ) { throw new ScmRepositoryException( "The scm url " + scmSpecificUrl + " is invalid.", result.messages ); } return result.repository; } catch ( ScmException e ) { // XXX We should allow throwing of SCMException. throw new ScmRepositoryException( "Error creating the scm repository", e ); } }
/** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { HgUrlParserResult result = parseScmUrl( scmSpecificUrl ); if ( result.messages.size() > 0 ) { throw new ScmRepositoryException( "The scm url is invalid.", result.messages ); } return result.repository; }
public ClearCaseScmProviderRepository( ScmLogger logger, String url, Settings settings ) throws ScmRepositoryException { this.logger = logger; this.settings = settings; try { parseUrl( url ); } catch ( MalformedURLException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } catch ( URISyntaxException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } catch ( UnknownHostException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } }
public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { ScmUrlParserResult result = parseScmUrl( scmSpecificUrl, delimiter ); if ( result.messages.size() > 0 ) { throw new ScmRepositoryException( "The scm url is invalid.", result.messages ); } return result.repository; }
/** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { try { ScmUrlParserResult result = parseScmUrl( scmSpecificUrl, delimiter ); if ( result.messages.size() > 0 ) { throw new ScmRepositoryException( "The scm url " + scmSpecificUrl + " is invalid.", result.messages ); } return result.repository; } catch ( ScmException e ) { // XXX We should allow throwing of SCMException. throw new ScmRepositoryException( "Error creating the scm repository", e ); } }
/** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { HgUrlParserResult result = parseScmUrl( scmSpecificUrl ); if ( result.messages.size() > 0 ) { throw new ScmRepositoryException( "The scm url is invalid.", result.messages ); } return result.repository; }
public ClearCaseScmProviderRepository( ScmLogger logger, String url, Settings settings ) throws ScmRepositoryException { this.logger = logger; this.settings = settings; try { parseUrl( url ); } catch ( MalformedURLException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } catch ( URISyntaxException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } catch ( UnknownHostException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } }
/** * @param url format is * project_name|delimiter|project_version|Release|Purpose|instance */ public SynergyScmProviderRepository( String url ) throws ScmRepositoryException { try { parseUrl( url ); } catch ( MalformedURLException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } catch ( URISyntaxException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } catch ( UnknownHostException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } }
/** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( File path ) throws ScmRepositoryException, UnknownRepositoryStructure { if ( path == null ) { throw new NullPointerException( "Path argument is null" ); } if ( !path.isDirectory() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a valid directory." ); } File hgDir = new File( path, ".hg" ); if ( !hgDir.exists() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a hg directory." ); } return makeProviderScmRepository( path.getAbsolutePath(), ':' ); }
/** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( File path ) throws ScmRepositoryException, UnknownRepositoryStructure { if ( path == null ) { throw new NullPointerException( "Path argument is null" ); } if ( !path.isDirectory() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a valid directory." ); } File hgDir = new File( path, ".hg" ); if ( !hgDir.exists() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a hg directory." ); } return makeProviderScmRepository( path.getAbsolutePath(), ':' ); }
/** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( File path ) throws ScmRepositoryException, UnknownRepositoryStructure { if ( path == null ) { throw new NullPointerException( "Path argument is null" ); } if ( !path.isDirectory() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a valid directory." ); } File bzrDir = new File( path, ".bzr" ); if ( !bzrDir.exists() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a bazaar directory." ); } return makeProviderScmRepository( "file:///" + path.getAbsolutePath(), ':' ); }
/** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { ScmUrlParserResult result = parseScmUrl( scmSpecificUrl, delimiter ); if ( result.getMessages().size() > 0 ) { throw new ScmRepositoryException( "The scm url is invalid.", result.getMessages() ); } return result.getRepository(); }
/** {@inheritDoc} */ protected String getRepositoryURL( File path ) throws ScmException { // Note: I need to supply just 1 absolute path, but ScmFileSet won't let me without // a basedir (which isn't used here anyway), so use a dummy file. // and a dummy ScmProviderRepository InfoScmResult result = info( new GitScmProviderRepository( path.toPath().toUri().toASCIIString() ), new ScmFileSet( path ), null ); if ( result.getInfoItems().size() != 1 ) { throw new ScmRepositoryException( "Cannot find URL: " + ( result.getInfoItems().size() == 0 ? "no" : "multiple" ) + " items returned by the info command" ); } return result.getInfoItems().get( 0 ).getURL(); } }
/** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { ScmUrlParserResult result = parseScmUrl( scmSpecificUrl, delimiter ); if ( result.getMessages().size() > 0 ) { throw new ScmRepositoryException( "The scm url is invalid.", result.getMessages() ); } return result.getRepository(); }
/** * {@inheritDoc} */ protected String getRepositoryURL( File path ) throws ScmException { // Note: I need to supply just 1 absolute path, but ScmFileSet won't let // me without // a basedir (which isn't used here anyway), so use a dummy file. InfoScmResult result = info( null, new ScmFileSet( new File( "" ), path ), null ); if ( result.getInfoItems().size() != 1 ) { throw new ScmRepositoryException( "Cannot find URL: " + ( result.getInfoItems().size() == 0 ? "no" : "multiple" ) + " items returned by the info command" ); } return ( (GitInfoItem) result.getInfoItems().get( 0 ) ).getURL(); }
/** {@inheritDoc} */ protected String getRepositoryURL( File path ) throws ScmException { // Note: I need to supply just 1 absolute path, but ScmFileSet won't let me without // a basedir (which isn't used here anyway), so use a dummy file. // and a dummy ScmProviderRepository InfoScmResult result = info( new GitScmProviderRepository( path.toPath().toUri().toASCIIString() ), new ScmFileSet( path ), null ); if ( result.getInfoItems().size() != 1 ) { throw new ScmRepositoryException( "Cannot find URL: " + ( result.getInfoItems().size() == 0 ? "no" : "multiple" ) + " items returned by the info command" ); } return result.getInfoItems().get( 0 ).getURL(); } }
/** * {@inheritDoc} */ protected String getRepositoryURL( File path ) throws ScmException { // Note: I need to supply just 1 absolute path, but ScmFileSet won't let // me without // a basedir (which isn't used here anyway), so use a dummy file. InfoScmResult result = info( null, new ScmFileSet( new File( "" ), path ), null ); if ( result.getInfoItems().size() != 1 ) { throw new ScmRepositoryException( "Cannot find URL: " + ( result.getInfoItems().size() == 0 ? "no" : "multiple" ) + " items returned by the info command" ); } return ( (GitInfoItem) result.getInfoItems().get( 0 ) ).getURL(); }
/** * {@inheritDoc} */ protected String getRepositoryURL( File path ) throws ScmException { // Note: I need to supply just 1 absolute path, but ScmFileSet won't let me without // a basedir (which isn't used here anyway), so use a dummy file. SvnInfoCommand infoCmd = (SvnInfoCommand) getInfoCommand(); infoCmd.setLogger( this.getLogger() ); InfoScmResult result = infoCmd.executeInfoCommand( null, new ScmFileSet( new File( "" ), path ), null, false, null ); if ( result.getInfoItems().size() != 1 ) { throw new ScmRepositoryException( "Cannot find URL: " + ( result.getInfoItems().size() == 0 ? "no" : "multiple" ) + " items returned by the info command" ); } return result.getInfoItems().get( 0 ).getURL(); }
/** * {@inheritDoc} */ protected String getRepositoryURL( File path ) throws ScmException { // Note: I need to supply just 1 absolute path, but ScmFileSet won't let me without // a basedir (which isn't used here anyway), so use a dummy file. SvnInfoCommand infoCmd = (SvnInfoCommand) getInfoCommand(); infoCmd.setLogger( this.getLogger() ); InfoScmResult result = infoCmd.executeInfoCommand( null, new ScmFileSet( new File( "" ), path ), null, false, null ); if ( result.getInfoItems().size() != 1 ) { throw new ScmRepositoryException( "Cannot find URL: " + ( result.getInfoItems().size() == 0 ? "no" : "multiple" ) + " items returned by the info command" ); } return result.getInfoItems().get( 0 ).getURL(); }
/** * @see org.apache.maven.scm.provider.ScmProvider#makeProviderScmRepository */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { P4ScmUrl parser = null; try { parser = P4ScmUrl.parse( P4ScmUrl.P4MAVEN_URL_PREFIX + scmSpecificUrl ); } catch ( Exception e ) { throw new ScmRepositoryException( e.getMessage() ); } return new P4ScmProviderRepository( parser.getProtocol(), parser.getHost(), parser.getPort(), parser.getPath(), parser.getUsername(), parser.getPassword() ); }