org.sonatype.nexus.proxy.repository.Repository.getPublishedMirrors()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(197)

本文整理了Java中org.sonatype.nexus.proxy.repository.Repository.getPublishedMirrors方法的一些代码示例,展示了Repository.getPublishedMirrors的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.getPublishedMirrors方法的具体详情如下:
包路径:org.sonatype.nexus.proxy.repository.Repository
类名称:Repository
方法名:getPublishedMirrors

Repository.getPublishedMirrors介绍

[英]Gets the published mirrors.
[中]获取已发布的镜像。

代码示例

代码示例来源:origin: org.sonatype.nexus.plugins/nexus-restlet1x-plugin

protected List<Mirror> getMirrors(Repository repository) {
 return repository.getPublishedMirrors().getMirrors();
}

代码示例来源:origin: org.sonatype.nexus.plugins/nexus-restlet1x-plugin

protected void setMirrors(Repository repository, List<Mirror> mirrors)
   throws IOException
 {
  //populate ids if not set
  for (Mirror mirror : mirrors) {
   if (StringUtils.isEmpty(mirror.getId())) {
    mirror.setId(mirror.getUrl());
   }
  }

  repository.getPublishedMirrors().setMirrors(mirrors);

  getNexusConfiguration().saveConfiguration();
 }
}

代码示例来源:origin: org.sonatype.nexus/nexus-app

PublishedMirrors publishedMirrors = repository.getPublishedMirrors();

代码示例来源:origin: org.sonatype.nexus/nexus-rest-api

protected List<Mirror> getMirrors( Repository repository )
{
  if ( repository.getRepositoryKind().isFacetAvailable( ProxyRepository.class ) )
  {
    return repository.adaptToFacet( ProxyRepository.class ).getDownloadMirrors().getMirrors();
  }
  else
  {
    return repository.getPublishedMirrors().getMirrors();
  }
}

代码示例来源:origin: org.sonatype.nexus/nexus-rest-api

protected void setMirrors( Repository repository, List<Mirror> mirrors )
    throws IOException
  {
    //populate ids if not set
    for ( Mirror mirror : mirrors )
    {
      if ( StringUtils.isEmpty( mirror.getId() ) )
      {
        mirror.setId( mirror.getUrl() );
      }
    }
    
    if ( repository.getRepositoryKind().isFacetAvailable( ProxyRepository.class ) )
    {
      repository.adaptToFacet( ProxyRepository.class ).getDownloadMirrors().setMirrors( mirrors );

      getNexusConfiguration().saveConfiguration();
    }
    else
    {
      repository.getPublishedMirrors().setMirrors( mirrors );

      getNexusConfiguration().saveConfiguration();
    }
  }
}

相关文章