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

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

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

Repository.getRepositoryKind介绍

[英]This is the "type"/kind of the repository. It tells some minimal info about the repo working (not content, neither implementation).
[中]这是存储库的“类型”/。它告诉了一些关于回购工作的最低限度的信息(不是内容,也不是实现)。

代码示例

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

/**
 * Repository is a proxy repository.
 */
private boolean ISPROXY(Repository repository) {
 return repository.getRepositoryKind().isFacetAvailable(MavenProxyRepository.class);
}

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

/**
 * Checks for a "default" behavior for not-found items. For those, we expect that repository is proxy repository,
 * and we allow further processing. For all other non-proxy repositories, we just return "not available", since
 * they
 * have no remote peer to download from, hence, since it is not found, it will be never there. Override if needed.
 */
protected boolean processNotFoundItems(Repository repo) {
 if (repo.getRepositoryKind().isFacetAvailable(HostedRepository.class)) {
  return false;
 }
 return true;
}

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

/**
 * Determine if a repository should be upgraded.
 * <br/>
 * A repo should not be upgraded if it is Group or Shadow faceted
 * @param repo The repo to check for upgrade
 * @return true if repo should be upgraded
 */
protected boolean shouldUpgradeRepository(Repository repo){
  // NEXUS-5099: Skipping shadows
  return !repo.getRepositoryKind().isFacetAvailable( GroupRepository.class )
    && !repo.getRepositoryKind().isFacetAvailable( MavenShadowRepository.class );
}

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

/**
 * Repository is a group repository.
 */
private boolean ISGROUP(Repository repository) {
 return repository.getRepositoryKind().isFacetAvailable(GroupRepository.class);
}

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

/**
 * Indexing is supported for this repository.
 */
private boolean SUPPORTED(Repository repository) {
 return !repository.getRepositoryKind().isFacetAvailable(ShadowRepository.class)
   && repository.getRepositoryKind().isFacetAvailable(MavenRepository.class)
   && repository.getRepositoryContentClass().isCompatible(maven2);
}

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

protected boolean isIndexingSupported( Repository repository )
{
  // indexing is supported if:
  // repo has NO Shadow facet available (is not a shadow)
  // repo has facet MavenRepository available (is implementation tied)
  // repo had contentClass compatible with Maven2 contentClass
  return !repository.getRepositoryKind().isFacetAvailable( ShadowRepository.class )
    && repository.getRepositoryKind().isFacetAvailable( MavenRepository.class )
    && repository.getRepositoryContentClass().isCompatible( maven2 );
}

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

/**
 * Archetype Catalog subjects are Maven2 hosted, proxy and group repositories that are In Service.
 */
private boolean isArchetypeCatalogSubject(final Repository repository) {
 return maven2ContentClass.isCompatible(repository.getRepositoryContentClass())
   && repository.getLocalStatus().shouldServiceRequest()
   && (repository.getRepositoryKind().isFacetAvailable(HostedRepository.class)
   || repository.getRepositoryKind().isFacetAvailable(ProxyRepository.class) ||
   repository.getRepositoryKind().isFacetAvailable(GroupRepository.class));
}

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

public static String getFullHumanizedNameString( final Repository repository )
  {
    return String.format( "%s[contentClass=%s][mainFacet=%s]", getHumanizedNameString( repository ),
      repository.getRepositoryContentClass().getName(), repository.getRepositoryKind().getMainFacet().getName() );
  }
}

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

protected String getRepositoryLocalUrl( Repository repository )
{
  if ( repository.getRepositoryKind().isFacetAvailable( GroupRepository.class ) )
  {
    return "@rootUrl@/content/groups/" + repository.getId();
  }
  else
  {
    return "@rootUrl@/content/repositories/" + repository.getId();
  }
}

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

@Override
 public void doApplyConfiguration(final Repository repository, final ApplicationConfiguration configuration,
                  final CRepositoryCoreConfiguration coreConfiguration)
   throws ConfigurationException
 {
  super.doApplyConfiguration(repository, configuration, coreConfiguration);

  if (repository.getRepositoryKind().isFacetAvailable(ProxyRepository.class)) {
   final ProxyRepository proxy = repository.adaptToFacet(ProxyRepository.class);

   proxy.getItemContentValidators().put("checksum", checksumValidator);
   proxy.getItemContentValidators().put("filetypevalidator", fileTypeItemContentValidator);
  }
 }
}

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

@Override
protected void validateMemberRepository(final Repository repository)
  throws InvalidGroupingException
{
 if (repository.getRepositoryKind().isFacetAvailable(P2CompositeGroupRepository.class)) {
  throw new InvalidGroupingException(String.format(
    "Repository '%s' cannot be grouped as P2 composite groups are not supported as members of P2 legacy groups",
    repository.getName()
  ));
 }
 super.validateMemberRepository(repository);
}

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

public static String getRepositoryPolicy( Repository repository )
  {
    if ( repository.getRepositoryKind().isFacetAvailable( MavenRepository.class ) )
    {
      return repository.adaptToFacet( MavenRepository.class ).getRepositoryPolicy().toString();
    }
    else
    {
      return null;
    }
  }
}

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

public static String getRepositoryPolicy(Repository repository) {
  if (repository.getRepositoryKind().isFacetAvailable(MavenRepository.class)) {
   return repository.adaptToFacet(MavenRepository.class).getRepositoryPolicy().toString();
  }
  else {
   return null;
  }
 }
}

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

@Override
  public Boolean getValueFor( RepositoryItemUid subject )
  {
    return subject.getRepository().getRepositoryKind().isFacetAvailable( MavenRepository.class )
      && M2ArtifactRecognizer.isChecksum( subject.getPath() );
  }
}

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

protected RepositoryGroupResource buildGroupResource( Request request, String groupId ) 
  throws NoSuchRepositoryException,
    ResourceException
{
  Repository repo = getRepositoryRegistry().getRepository( groupId );
  
  if ( repo.getRepositoryKind().isFacetAvailable( GroupRepository.class ) )
  {
    return buildGroupResource( request, repo.adaptToFacet( GroupRepository.class ) );
  }
  
  return null;
}

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

protected RepositoryGroupResource buildGroupResource(Request request, String groupId)
  throws NoSuchRepositoryException,
      ResourceException
{
 Repository repo = getRepositoryRegistry().getRepository(groupId);
 if (repo.getRepositoryKind().isFacetAvailable(GroupRepository.class)) {
  return buildGroupResource(request, repo.adaptToFacet(GroupRepository.class));
 }
 return null;
}

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

@Override
  public Boolean getValueFor( RepositoryItemUid subject )
  {
    return subject.getRepository().getRepositoryKind().isFacetAvailable( MavenRepository.class )
      && M2ArtifactRecognizer.isMetadata( subject.getPath() )
      && !M2ArtifactRecognizer.isChecksum( subject.getPath() );
  }
}

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

@Override
  public Boolean getValueFor( RepositoryItemUid subject )
  {
    return subject.getRepository().getRepositoryKind().isFacetAvailable( MavenRepository.class )
      && M2ArtifactRecognizer.isPom( subject.getPath() ) && !M2ArtifactRecognizer.isChecksum( subject.getPath() );
  }
}

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

@Override
public Boolean getValueFor( RepositoryItemUid subject )
{
  return subject.getRepository().getRepositoryKind().isFacetAvailable( MavenRepository.class )
    && pathIsValidGav( subject.getRepository().adaptToFacet( MavenRepository.class ), subject.getPath() );
}

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

@Override
public Boolean getValueFor( RepositoryItemUid subject )
{
  return subject.getRepository().getRepositoryKind().isFacetAvailable( MavenRepository.class )
    && pathIsValidSnapshotGav( subject.getRepository().adaptToFacet( MavenRepository.class ), subject.getPath() );
}

相关文章