Package org.sonatype.nexus.proxy.walker

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


      throws Exception
  {
    final File repoLocation = this.addRepository("active-repo");

    final DefaultWastebasket wastebasket = (DefaultWastebasket) this.lookup(Wastebasket.class);
    final Walker walker = wastebasket.getWalker();
    wastebasket.setWalker(
        new Walker()
        {
          @Override
          public void walk(final WalkerContext context)
              throws WalkerException
          {
            context.getProcessors().add(0, new AbstractWalkerProcessor()
            {
              @Override
              public void processItem(final WalkerContext context, final StorageItem item)
                  throws Exception
              {
                // do noting
              }

              @Override
              public void onCollectionExit(final WalkerContext context, final StorageCollectionItem coll)
                  throws Exception
              {
                FileUtils.deleteDirectory(new File(repoLocation, coll.getPath()));
              }
            });
            walker.walk(context);
          }
        }
    );
    wastebasket.purgeAll(DefaultWastebasket.ALL);
  }
View Full Code Here


      {
        exitedCollections.add(coll.getPath());
      }

    });
    final Walker walker = lookup(Walker.class);

    // walk
    try {
      walker.walk(context);
      assertThat("Walk must fail as we planted a mine in there!", false);
    }
    catch (WalkerException e) {
      assertThat("Reason must state walk is \"aborted\"", e.getMessage().toLowerCase().contains("aborted"));
      assertThat("Reason must refer to our repo ID=" + REPO_ID,
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.proxy.walker.Walker

Copyright © 2018 www.massapicom. 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.