Examples of retrieveItem()


Examples of org.sonatype.nexus.proxy.maven.maven2.M2Repository.retrieveItem()

    }

    // now do a fetch
    // this verifies that an assertion ("path in question does not exists in proxy cache but does exists on remote")
    // also verifies that cstamas did not mistype the paths in @Test method ;)
    repository.retrieveItem(retrieveRequest);

    // files SHOULD be pulled down
    {
      File artifactFile;
      if (!M2ArtifactRecognizer.isChecksum(path)) {
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.maven2.M2Repository.retrieveItem()

    ResourceStoreRequest request = new ResourceStoreRequest(requestPath, false, false);

    repo.setChecksumPolicy(policy);
    repo.getCurrentCoreConfiguration().commitChanges();

    StorageFileItem item = (StorageFileItem) repo.retrieveItem(request);

    return item;
  }

  private boolean cachedHashItem(final String itemPath, String suffix)
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.GroupRepository.retrieveItem()

    final GroupRepository group =
        getRepositoryRegistry().getRepositoryWithFacet("another-test", GroupRepository.class);

    try {
      group.retrieveItem(new ResourceStoreRequest("/some/path/that/we/know/is/not/existing/123456/12.foo"));
      // anything else should fail
      fail("We expected an exception here!");
    }
    catch (GroupItemNotFoundException e) {
      final String dumpStr = dumpNotFoundReasoning(e, 0);
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.ProxyRepository.retrieveItem()

  @Test
  public void deleteCollectionWithSiblings()
      throws Exception
  {
    final ProxyRepository repo1 = getRepositoryRegistry().getRepositoryWithFacet("repo1", ProxyRepository.class);
    repo1.retrieveItem(new ResourceStoreRequest("/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.pom"));

    // install listener
    final DeleteEventsListener listener = new DeleteEventsListener();
    eventBus().register(listener);
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.ProxyRepository.retrieveItem()

  @Test
  public void deleteEmptyCollection()
      throws Exception
  {
    final ProxyRepository repo1 = getRepositoryRegistry().getRepositoryWithFacet("repo1", ProxyRepository.class);
    repo1.retrieveItem(new ResourceStoreRequest("/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.pom"));

    // perform delete a bit lower
    repo1.deleteItem(new ResourceStoreRequest("/org/slf4j"));

    // install listener
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.ProxyRepository.retrieveItem()

  @Test
  public void deleteNonCollection()
      throws Exception
  {
    final ProxyRepository repo1 = getRepositoryRegistry().getRepositoryWithFacet("repo1", ProxyRepository.class);
    repo1.retrieveItem(new ResourceStoreRequest("/spoof/spoof/1.0/spoof-1.0.txt"));
    repo1.retrieveItem(new ResourceStoreRequest("/spoof/maven-metadata.xml"));

    // install listener
    final DeleteEventsListener listener = new DeleteEventsListener();
    eventBus().register(listener);
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.ProxyRepository.retrieveItem()

  public void deleteNonCollection()
      throws Exception
  {
    final ProxyRepository repo1 = getRepositoryRegistry().getRepositoryWithFacet("repo1", ProxyRepository.class);
    repo1.retrieveItem(new ResourceStoreRequest("/spoof/spoof/1.0/spoof-1.0.txt"));
    repo1.retrieveItem(new ResourceStoreRequest("/spoof/maven-metadata.xml"));

    // install listener
    final DeleteEventsListener listener = new DeleteEventsListener();
    eventBus().register(listener);
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.Repository.retrieveItem()

    shadowRequest.getRequestContext().put(AccessManager.REQUEST_REMOTE_ADDRESS, "127.0.0.1");
    masterRequest.getRequestContext().put(AccessManager.REQUEST_REMOTE_ADDRESS, "127.0.0.1");

    StorageItem shadowItem = shadowRepository.retrieveItem(shadowRequest);
    assertTrue("Shadow MUST return a link", StorageLinkItem.class.isAssignableFrom(shadowItem.getClass()));
    StorageItem masterItem = masterRepository.retrieveItem(masterRequest);
    assertTrue("Master MUST NOT return a link", !StorageLinkItem.class.isAssignableFrom(masterItem.getClass()));

    // produce a lastRequest timestamp to now less 10 days
    long lastRequest = System.currentTimeMillis() - 10 * A_DAY;

 
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.Repository.retrieveItem()

      final Repository repository = getRepositoryRegistry().getRepository("repo1");
      final ResourceStoreRequest request =
          new ResourceStoreRequest("/activemq/activemq-core/1.2/activemq-core-1.2.jar");

      try {
        final StorageItem item = repository.retrieveItem(request);
        fail("We expected a LocalStorageEofException to be thrown");
      }
      catch (LocalStorageEOFException e) {
        // good, we expected this
      }
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.Repository.retrieveItem()

  @Override
  public String renderStatus() {
    if (isConfigured()) {
      try {
        final Repository repository = repositoryRegistry.getRepository(getConfig().repository());
        final StorageItem storageItem = repository.retrieveItem(
            new ResourceStoreRequest(YumConfigContentGenerator.configFilePath(repository.getId()), true)
        );
        if (storageItem instanceof StorageFileItem) {
          try (InputStream in = ((StorageFileItem) storageItem).getInputStream()) {
            return
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.