当前位置: 首页>>代码示例>>Java>>正文


Java SvnScmProviderRepository类代码示例

本文整理汇总了Java中org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository的典型用法代码示例。如果您正苦于以下问题:Java SvnScmProviderRepository类的具体用法?Java SvnScmProviderRepository怎么用?Java SvnScmProviderRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SvnScmProviderRepository类属于org.apache.maven.scm.provider.svn.repository包,在下文中一共展示了SvnScmProviderRepository类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderAccessBehindFirewallSection

import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; //导入依赖的package包/类
/**
 * Render the access from behind a firewall section
 *
 * @param devRepository the dev repository
 */
private void renderAccessBehindFirewallSection(ScmRepository devRepository) {
    startSection(getI18nString("accessbehindfirewall.title"));

    if (devRepository != null && isScmSystem(devRepository, "svn")) {
        SvnScmProviderRepository svnRepo = (SvnScmProviderRepository) devRepository.getProviderRepository();

        paragraph(getI18nString("accessbehindfirewall.svn.intro"));

        verbatimText("$ svn checkout " + svnRepo.getUrl() + " " + checkoutDirectoryName);
    } else if (devRepository != null && isScmSystem(devRepository, "cvs")) {
        linkPatternedText(getI18nString("accessbehindfirewall.cvs.intro"));
    } else {
        paragraph(getI18nString("accessbehindfirewall.general.intro"));
    }

    endSection();
}
 
开发者ID:bsorrentino,项目名称:maven-confluence-plugin,代码行数:23,代码来源:ScmRenderer.java

示例2: renderAnonymousAccessSection

import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; //导入依赖的package包/类
/**
 * Render the anonymous access section depending the repository.
 * <p>
 * Note: ClearCase, Starteam et Perforce seems to have no anonymous access.
 * </p>
 *
 * @param anonymousRepository the anonymous repository
 */
private void renderAnonymousAccessSection(ScmRepository anonymousRepository) {
    if (isScmSystem(anonymousRepository, "clearcase") || isScmSystem(anonymousRepository, "perforce")
            || isScmSystem(anonymousRepository, "starteam") || StringUtils.isEmpty(anonymousConnection)) {
        return;
    }

    startSection(getI18nString("anonymousaccess.title"));

    if (anonymousRepository != null && isScmSystem(anonymousRepository, "cvs")) {
        CvsScmProviderRepository cvsRepo
                = (CvsScmProviderRepository) anonymousRepository.getProviderRepository();

        anonymousAccessCVS(cvsRepo);
    } else if (anonymousRepository != null && isScmSystem(anonymousRepository, "git")) {
        GitScmProviderRepository gitRepo
                = (GitScmProviderRepository) anonymousRepository.getProviderRepository();

        anonymousAccessGit(gitRepo);
    } else if (anonymousRepository != null && isScmSystem(anonymousRepository, "hg")) {
        HgScmProviderRepository hgRepo = (HgScmProviderRepository) anonymousRepository.getProviderRepository();

        anonymousAccessMercurial(hgRepo);
    } else if (anonymousRepository != null && isScmSystem(anonymousRepository, "svn")) {
        SvnScmProviderRepository svnRepo
                = (SvnScmProviderRepository) anonymousRepository.getProviderRepository();

        anonymousAccessSubversion(svnRepo);
    } else {
        paragraph(getI18nString("anonymousaccess.general.intro"));

        verbatimText(anonymousConnection.substring(4));
    }

    endSection();
}
 
开发者ID:bsorrentino,项目名称:maven-confluence-plugin,代码行数:44,代码来源:ScmRenderer.java

示例3: developerAccessSubversion

import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; //导入依赖的package包/类
/**
 * Create the documentation to provide an developer access with a
 * <code>Subversion</code> SCM. For example, generate the following command
 * line:
 * <p>
 * svn checkout https://svn.apache.org/repos/asf/maven/components/trunk
 * maven
 * </p>
 * <p>
 * svn commit --username your-username -m "A message"
 * </p>
 *
 * @param svnRepo
 * @see
 * <a href="http://svnbook.red-bean.com/">http://svnbook.red-bean.com/</a>
 */
private void developerAccessSubversion(SvnScmProviderRepository svnRepo) {
    if (svnRepo.getUrl() != null) {
        if (svnRepo.getUrl().startsWith("https://")) {
            paragraph(getI18nString("devaccess.svn.intro1.https"));
        } else if (svnRepo.getUrl().startsWith("svn://")) {
            paragraph(getI18nString("devaccess.svn.intro1.svn"));
        } else if (svnRepo.getUrl().startsWith("svn+ssh://")) {
            paragraph(getI18nString("devaccess.svn.intro1.svnssh"));
        } else {
            paragraph(getI18nString("devaccess.svn.intro1.other"));
        }
    }

    StringBuilder sb = new StringBuilder();

    sb.append("$ svn checkout ").append(svnRepo.getUrl()).append(" ").append(checkoutDirectoryName);

    verbatimText(sb.toString());

    paragraph(getI18nString("devaccess.svn.intro2"));

    sb = new StringBuilder();
    sb.append("$ svn commit --username your-username -m \"A message\"");

    verbatimText(sb.toString());
}
 
开发者ID:bsorrentino,项目名称:maven-confluence-plugin,代码行数:43,代码来源:ScmRenderer.java

示例4: remoteUrlExist

import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; //导入依赖的package包/类
public boolean remoteUrlExist( ScmProviderRepository repository, CommandParameters parameters )
    throws ScmException
{
    SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repository;

    String url = ( (SvnScmProviderRepository) repository ).getUrl();

    try
    {

        javaRepo.getClientManager().getWCClient().doInfo( SVNURL.parseURIEncoded( url ), SVNRevision.HEAD,
                                                          SVNRevision.HEAD, SVNDepth.EMPTY, new ISVNInfoHandler()
        {
            public void handleInfo( SVNInfo svnInfo )
                throws SVNException
            {
                svnInfo.getAuthor();
            }
        } );
    }
    catch ( SVNException e )
    {
        if ( e.getMessage().indexOf( "E170000" ) > -1 )
        {
            return false;
        }
        throw new ScmException( e.getMessage(), e );
    }
    return true;
}
 
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:31,代码来源:SvnJavaRemoteInfoCommand.java

示例5: createRepository

import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; //导入依赖的package包/类
/**
 * Creates and configures the SCM repository.
 *
 * @param scmManager the manager to create the repository dependent on the
 *          {@link #getConnectionUrl() connection URL}.
 * @return the repository implementation to connect to the SCM system.
 * @throws ScmException if the repository implementation cannot be created or
 *           configured. This happens especially if no provider exists for the
 *           given connection URL.
 */
public ScmRepository createRepository(final ScmManager scmManager)
  throws ScmException
{
  try
  {
    final ScmRepository repository =
        scmManager.makeScmRepository(connectionUrl);

    final ScmProviderRepository providerRepository =
        repository.getProviderRepository();
    configure(providerRepository);

    if (repository.getProviderRepository() instanceof ScmProviderRepositoryWithHost)
    {
      final ScmProviderRepositoryWithHost providerRepositoryWithHost =
          (ScmProviderRepositoryWithHost) repository.getProviderRepository();
      configure(providerRepositoryWithHost);
    }

    if (!StringUtils.isEmpty(tagBase)
        && repository.getProvider().equals("svn"))
    {
      final SvnScmProviderRepository svnRepository =
          (SvnScmProviderRepository) repository.getProviderRepository();
      configure(svnRepository);
    }
    return repository;
  }
  catch (final Exception e)
  {
    throw new ScmException("The SCM provider cannot be created.", e);
  }
}
 
开发者ID:release-engineering,项目名称:buildmetadata-maven-plugin,代码行数:44,代码来源:ScmConnectionInfo.java

示例6: renderDeveloperAccessSection

import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; //导入依赖的package包/类
/**
 * Render the developer access section
 *
 * @param devRepository the dev repository
 */
private void renderDeveloperAccessSection(ScmRepository devRepository) {
    if (StringUtils.isEmpty(devConnection)) {
        return;
    }

    startSection(getI18nString("devaccess.title"));

    if (devRepository != null && isScmSystem(devRepository, "clearcase")) {
        developerAccessClearCase();
    } else if (devRepository != null && isScmSystem(devRepository, "cvs")) {
        CvsScmProviderRepository cvsRepo = (CvsScmProviderRepository) devRepository.getProviderRepository();

        developerAccessCVS(cvsRepo);
    } else if (devRepository != null && isScmSystem(devRepository, "git")) {
        GitScmProviderRepository gitRepo = (GitScmProviderRepository) devRepository.getProviderRepository();

        developerAccessGit(gitRepo);
    } else if (devRepository != null && isScmSystem(devRepository, "hg")) {
        HgScmProviderRepository hgRepo = (HgScmProviderRepository) devRepository.getProviderRepository();

        developerAccessMercurial(hgRepo);
    } else if (devRepository != null && isScmSystem(devRepository, "perforce")) {
        PerforceScmProviderRepository perforceRepo
                = (PerforceScmProviderRepository) devRepository.getProviderRepository();

        developerAccessPerforce(perforceRepo);
    } else if (devRepository != null && isScmSystem(devRepository, "starteam")) {
        StarteamScmProviderRepository starteamRepo
                = (StarteamScmProviderRepository) devRepository.getProviderRepository();

        developerAccessStarteam(starteamRepo);
    } else if (devRepository != null && isScmSystem(devRepository, "svn")) {
        SvnScmProviderRepository svnRepo = (SvnScmProviderRepository) devRepository.getProviderRepository();

        developerAccessSubversion(svnRepo);
    } else {
        paragraph(getI18nString("devaccess.general.intro"));

        verbatimText(devConnection.substring(4));
    }

    endSection();
}
 
开发者ID:bsorrentino,项目名称:maven-confluence-plugin,代码行数:49,代码来源:ScmRenderer.java

示例7: executeUpdateCommand

import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion tag )
    throws ScmException
{
    SvnScmProviderRepository repository = (SvnScmProviderRepository) repo;

    if ( getLogger().isInfoEnabled() )
    {
        getLogger().info( "SVN update directory: " + fileSet.getBasedir().getAbsolutePath() );
    }

    SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo;

    try
    {
        ScmFileEventHandler handler = new ScmFileEventHandler( getLogger(), fileSet.getBasedir() );

        SVNUpdateClient updateClient = javaRepo.getClientManager().getUpdateClient();

        updateClient.setEventHandler( handler );

        long revision = 0;

        if ( tag == null || SvnTagBranchUtils.isRevisionSpecifier( tag ) )
        {
            SVNRevision rev = ( tag == null ? SVNRevision.parse( "" ) : SVNRevision.parse( tag.getName() ) );
            revision = SvnJavaUtil.update( updateClient, fileSet.getBasedir(), rev, true );
        }
        else
        {
            // The tag specified does not appear to be numeric, so assume it refers
            // to a branch/tag url and perform a switch operation rather than update
            revision = SvnJavaUtil.switchToURL( javaRepo.getClientManager(), fileSet.getBasedir(),
                                                SVNURL.parseURIEncoded( SvnTagBranchUtils.resolveTagUrl( repository,
                                                                                                         new ScmTag(
                                                                                                             tag.getName() ) ) ),
                                                SVNRevision.HEAD, true );
        }

        return new UpdateScmResultWithRevision( SvnJavaScmProvider.COMMAND_LINE, handler.getFiles(),
                                                Long.toString( revision ) );
    }
    catch ( SVNException e )
    {
        return new UpdateScmResultWithRevision( SvnJavaScmProvider.COMMAND_LINE, "SVN update failed.",
                                                e.getMessage(), Long.toString( -1 ), false );
    }
    finally
    {
        javaRepo.getClientManager().getUpdateClient().setEventHandler( null );
    }
}
 
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:55,代码来源:SvnJavaUpdateCommand.java

示例8: executeCheckOutCommand

import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
                                                    ScmVersion version, boolean recursive )
    throws ScmException
{
    if ( getLogger().isInfoEnabled() )
    {
        getLogger().info( "SVN checkout directory: " + fileSet.getBasedir().getAbsolutePath() );
    }

    SvnScmProviderRepository repository = (SvnScmProviderRepository) repo;

    String url = repository.getUrl();

    SVNRevision revision = SVNRevision.HEAD;

    if ( version != null && StringUtils.isNotEmpty( version.getName() ) )
    {
        if ( version instanceof ScmTag )
        {
            url = SvnTagBranchUtils.resolveTagUrl( repository, (ScmTag) version );
        }
        else if ( version instanceof ScmBranch )
        {
            url = SvnTagBranchUtils.resolveBranchUrl( repository, (ScmBranch) version );
        }
        else if ( version instanceof ScmRevision )
        {
            try
            {
                revision = SVNRevision.create( Long.parseLong( ( (ScmRevision) version ).getName() ) );
            }
            catch ( NumberFormatException exc )
            {
                return new CheckOutScmResult( SvnJavaScmProvider.COMMAND_LINE,
                                              "SVN checkout failed. Wrong format of revision number.", null,
                                              false );
            }
        }
    }

    url = SvnCommandUtils.fixUrl( url, repository.getUser() );

    SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo;

    ScmFileEventHandler handler = new ScmFileEventHandler( getLogger(), fileSet.getBasedir() );
    SVNUpdateClient updateClient = javaRepo.getClientManager().getUpdateClient();
    updateClient.setEventHandler( handler );

    try
    {
        SvnJavaUtil.checkout( updateClient, SVNURL.parseURIEncoded( url ), revision, fileSet.getBasedir(), true );

        return new CheckOutScmResult( SvnJavaScmProvider.COMMAND_LINE, handler.getFiles() );
    }
    catch ( SVNException e )
    {
        return new CheckOutScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN checkout failed.", e.getMessage(),
                                      false );
    }
    finally
    {
        javaRepo.getClientManager().getUpdateClient().setEventHandler( null );
    }
}
 
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:68,代码来源:SvnJavaCheckOutCommand.java

示例9: testUrl

import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; //导入依赖的package包/类
private void testUrl( String scmUrl, String expectedUrl, String expectedUser )
    throws Exception
{
    ScmRepository repository = scmManager.makeScmRepository( scmUrl );

    assertNotNull( "ScmManager.makeScmRepository() returned null", repository );

    assertNotNull( "The provider repository was null.", repository.getProviderRepository() );

    assertTrue( "The SCM Repository isn't a " + SvnScmProviderRepository.class.getName() + ".",
                repository.getProviderRepository() instanceof SvnScmProviderRepository );

    SvnScmProviderRepository providerRepository =
        (SvnScmProviderRepository) repository.getProviderRepository();

    assertEquals( "url is incorrect", expectedUrl, providerRepository.getUrl() );

    assertEquals( "User is incorrect", expectedUser, providerRepository.getUser() );
}
 
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:20,代码来源:SvnScmProviderRepositoryTest.java

示例10: anonymousAccessSubversion

import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; //导入依赖的package包/类
/**
 * Create the documentation to provide an anonymous access with a
 * <code>Subversion</code> SCM. For example, generate the following command
 * line:
 * <p>
 * svn checkout http://svn.apache.org/repos/asf/maven/components/trunk maven
 * </p>
 *
 * @param svnRepo
 * @see
 * <a href="http://svnbook.red-bean.com/">http://svnbook.red-bean.com/</a>
 */
private void anonymousAccessSubversion(SvnScmProviderRepository svnRepo) {
    paragraph(getI18nString("anonymousaccess.svn.intro"));

    verbatimText("$ svn checkout " + svnRepo.getUrl() + " " + checkoutDirectoryName);
}
 
开发者ID:bsorrentino,项目名称:maven-confluence-plugin,代码行数:18,代码来源:ScmRenderer.java

示例11: configure

import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; //导入依赖的package包/类
/**
 * Configures the repository with the tag base information.
 *
 * @param repository the repository instance to configure.
 */
protected void configure(final SvnScmProviderRepository repository)
{
  repository.setTagBase(tagBase);
}
 
开发者ID:release-engineering,项目名称:buildmetadata-maven-plugin,代码行数:10,代码来源:ScmConnectionInfo.java


注:本文中的org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。