Package org.sonatype.nexus.proxy.item

Examples of org.sonatype.nexus.proxy.item.StorageCollectionItem.list()


        // this should be a collection Item
        if (StorageCollectionItem.class.isInstance(parentItem)) {
          StorageCollectionItem parentCollectionItem = (StorageCollectionItem) parentItem;
          try {
            if (parentCollectionItem.list().size() == 0) {
              deleteItem(false, parentRequest);
              parentRequest = new ResourceStoreRequest(parentCollectionItem.getParentPath());
            }
            else {
              // exit loop
View Full Code Here


    assertEquals("/activemq/activemq-core", item.getParentPath());
    assertEquals("1.2", item.getName());
    assertTrue(StorageCollectionItem.class.isAssignableFrom(item.getClass()));

    StorageCollectionItem coll = (StorageCollectionItem) item;
    Collection<StorageItem> items = coll.list();
    assertEquals(1, items.size());
    StorageItem collItem = items.iterator().next();
    assertEquals("/activemq/activemq-core/1.2/activemq-core-1.2.jar", collItem.getPath());
    assertEquals("activemq-core-1.2.jar", collItem.getName());
    assertEquals("/activemq/activemq-core/1.2", collItem.getParentPath());
View Full Code Here

      // marker arrived back in item context
      assertThat(item.getItemContext().flatten(), hasKey(MARKER_KEY));
      // is a collection
      assertThat(item, instanceOf(StorageCollectionItem.class));
      final StorageCollectionItem root = (StorageCollectionItem) item;
      final Collection<StorageItem> children = root.list();
      for (StorageItem child : children) {
        // marker arrived back in item context even for children
        assertThat(child.getItemContext().flatten(), hasKey(MARKER_KEY));
      }
    }
View Full Code Here

      // marker arrived back in item context
      assertThat(item.getItemContext().flatten(), hasKey(MARKER_KEY));
      // is a collection
      assertThat(item, instanceOf(StorageCollectionItem.class));
      final StorageCollectionItem root = (StorageCollectionItem) item;
      final Collection<StorageItem> children = root.list();
      for (StorageItem child : children) {
        // marker arrived back in item context even for children
        assertThat(child.getItemContext().flatten(), hasKey(MARKER_KEY));
      }
    }
View Full Code Here

      // marker arrived back in item context
      assertThat(item.getItemContext().flatten(), hasKey(MARKER_KEY));
      // is a collection
      assertThat(item, instanceOf(StorageCollectionItem.class));
      final StorageCollectionItem root = (StorageCollectionItem) item;
      final Collection<StorageItem> children = root.list();
      for (StorageItem child : children) {
        // marker arrived back in item context even for children
        assertThat(child.getItemContext().flatten(), hasKey(MARKER_KEY));
      }
    }
View Full Code Here

    req = new ResourceStoreRequest("/", true);

    StorageCollectionItem coll = (StorageCollectionItem) getResourceStore().retrieveItem(req);

    for (StorageItem item : coll.list()) {
      System.out.println(item.getPath());
    }
  }

}
View Full Code Here

    StorageItem item = router.retrieveItem(request);

    StorageCollectionItem collectionItem = (StorageCollectionItem) item;

    // this user only has access to repo1, that is all they should see
    Assert.assertEquals("User should only have access to 'repo1'", 1, collectionItem.list().size());
    Assert.assertEquals("repo1", collectionItem.list().iterator().next().getName());

    // logout user
    this.securitySystem.logout(subject);
  }
View Full Code Here

    StorageCollectionItem collectionItem = (StorageCollectionItem) item;

    // this user only has access to repo1, that is all they should see
    Assert.assertEquals("User should only have access to 'repo1'", 1, collectionItem.list().size());
    Assert.assertEquals("repo1", collectionItem.list().iterator().next().getName());

    // logout user
    this.securitySystem.logout(subject);
  }
View Full Code Here

    StorageItem item = router.retrieveItem(request);

    StorageCollectionItem collectionItem = (StorageCollectionItem) item;

    // this user only has access to repo1, that is all they should see
    Assert.assertEquals("User should not have access to any repos", 0, collectionItem.list().size());

    // logout user
    this.securitySystem.logout(subject);
  }
View Full Code Here

    ResourceStoreRequest request = new ResourceStoreRequest("/repositories/");

    StorageItem item = router.retrieveItem(request);

    StorageCollectionItem collectionItem = (StorageCollectionItem) item;
    Assert.assertEquals("User should see 8 repositories", 8, collectionItem.list().size()); // we create a new
    // repo for each
    // shadow

    List<String> repoIds = new ArrayList<String>();
    for (StorageItem tmpItem : collectionItem.list()) {
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.