Examples of DottedStoreWalkerFilter


Examples of org.sonatype.nexus.proxy.walker.DottedStoreWalkerFilter

  /**
   * Create an appropriate filter based on the repositoryTarget
   */
  private WalkerFilter determineFilter(final Target repositoryTarget) {
    if (repositoryTarget == null) {
      return new DottedStoreWalkerFilter();
    }
    return ConjunctionWalkerFilter.satisfiesAllOf(new DottedStoreWalkerFilter(),
        new TargetStoreWalkerFilter(repositoryTarget));
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.walker.DottedStoreWalkerFilter

        new SnapshotRemoverWalkerProcessor(repository, request, parentOMatic);

    final DefaultWalkerContext ctxMain =
        new DefaultWalkerContext(repository,
            new ResourceStoreRequest("/"),
            new DottedStoreWalkerFilter(),
            TraversalType.BREADTH_FIRST,
            false);
    ctxMain.getContext().put(DeleteOperation.DELETE_OPERATION_CTX_KEY, getDeleteOperation(request));
    ctxMain.getProcessors().add(snapshotRemoveProcessor);
    walker.walk(ctxMain);

    if (ctxMain.getStopCause() != null) {
      result.setSuccessful(false);
    }

    // and collect results
    result.setDeletedSnapshots(snapshotRemoveProcessor.getDeletedSnapshots());
    result.setDeletedFiles(snapshotRemoveProcessor.getDeletedFiles());

    if (log.isDebugEnabled()) {
      log.debug(
          "Collected and deleted " + snapshotRemoveProcessor.getDeletedSnapshots()
              + " snapshots with alltogether " + snapshotRemoveProcessor.getDeletedFiles()
              + " files on repository " + repository.getId()
      );
    }

    // if we are processing a hosted-snapshot repository, we need to rebuild maven metadata
    // without this if below, the walk would happen against proxy repositories too, but doing nothing!
    if (repository.getRepositoryKind().isFacetAvailable(HostedRepository.class)) {
      // expire NFC since we might create new maven metadata files
      repository.expireNotFoundCaches(new ResourceStoreRequest(RepositoryItemUid.PATH_ROOT));

      RecreateMavenMetadataWalkerProcessor metadataRebuildProcessor =
          new RecreateMavenMetadataWalkerProcessor(log, getDeleteOperation(request));

      for (String path : parentOMatic.getMarkedPaths()) {
        TaskUtil.checkInterruption();

        DefaultWalkerContext ctxMd =
            new DefaultWalkerContext(repository, new ResourceStoreRequest(path),
                new DottedStoreWalkerFilter());

        ctxMd.getProcessors().add(metadataRebuildProcessor);

        try {
          walker.walk(ctxMd);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.