Package org.sonatype.nexus.proxy

Examples of org.sonatype.nexus.proxy.ResourceStoreRequest


    // not-indexable repository do not have indexing context
    Assert.assertNull(indexerManager.getRepositoryIndexContext(releases));

    // TODO figure out how to assert these operations don't do anything

    ResourceStoreRequest request = new ResourceStoreRequest("item", true, false);
    StorageFileItem item =
        new DefaultStorageFileItem(releases, request, true /* canRead */, true/* canWrite */, contentLocator);

    indexerManager.addItemToIndex(releases, item);
    indexerManager.removeItemFromIndex(apacheSnapshots, item);
View Full Code Here


  private void deployFile(MavenRepository repository, String repoFrom, String path)
      throws IOException, UnsupportedStorageOperationException
  {
    File repos = new File(getBasedir(), "src/test/resources/reposes").getCanonicalFile();
    FileContentLocator content = new FileContentLocator(new File(repos, repoFrom + path), "mime-type");
    ResourceStoreRequest request = new ResourceStoreRequest(path);
    StorageItem item = new DefaultStorageFileItem(repository, request, true, true, content);
    repository.getLocalStorage().storeItem(repository, item);
  }
View Full Code Here

  }

  private StorageItem createItem(MavenRepository repository, String path)
      throws Exception
  {
    return repository.retrieveItem(new ResourceStoreRequest(path));
  }
View Full Code Here

  {
    Assert.assertNotNull(mavenBridge);

    MavenRepository publicRepo = repositoryRegistry.getRepositoryWithFacet("public", MavenGroupRepository.class);

    ResourceStoreRequest req =
        new ResourceStoreRequest("/org/apache/maven/apache-maven/3.0-beta-1/apache-maven-3.0-beta-1.pom");

    StorageFileItem pomItem = (StorageFileItem) publicRepo.retrieveItem(req);

    ModelSource pomSource = new FileItemModelSource(pomItem);
View Full Code Here

          Gav gav =
              new Gav(ai.groupId, ai.artifactId, ai.version, ai.classifier,
                  mavenRepository.getArtifactPackagingMapper().getExtensionForPackaging(ai.packaging),
                  null, null, null, false, null, false, null);

          ResourceStoreRequest req =
              new ResourceStoreRequest(mavenRepository.getGavCalculator().gavToPath(gav));

          a.setResourceURI(createRepositoryReference(request, ai.repository, req.getRequestPath()).toString());
        }
      }
      catch (NoSuchRepositoryException e) {
        getLogger().warn("No such repository: '" + ai.repository + "'.", e);
View Full Code Here

    // enable index download
    enableIndexDownload();
    // check uniqueness
    ensureUniqueness();
    // simulate Maven fetch, get something cached
    central.retrieveItem(new ResourceStoreRequest("/log4j/log4j/1.2.13/log4j-1.2.13.pom"));
    central.retrieveItem(new ResourceStoreRequest("/log4j/log4j/1.2.13/log4j-1.2.13.jar"));
    waitForAsync(); // indexing happens async
    // check uniqueness
    ensureUniqueness();
    // update indexes, that will trigger buggy scan of local storage
    indexerManager.reindexRepository(null, central.getId(), false);
View Full Code Here

    // enable index download
    enableIndexDownload();
    // check uniqueness
    ensureUniqueness();
    // simulate Maven fetch, get something cached
    central.retrieveItem(new ResourceStoreRequest("/log4j/log4j/1.2.13/log4j-1.2.13.pom"));
    central.retrieveItem(new ResourceStoreRequest("/log4j/log4j/1.2.13/log4j-1.2.13.jar"));
    waitForAsync(); // indexing happens async
    // check uniqueness
    ensureUniqueness();
    // repair indexes, that will trigger buggy scan of local storage
    indexerManager.reindexRepository(null, central.getId(), true);
View Full Code Here

    when(itemUid.getBooleanAttributeValue(IsRemotelyAccessibleAttribute.class)).thenReturn(true);

    when(collectionItem.getRepositoryItemUid()).thenReturn(itemUid);
    when(fileItem.getRepositoryItemUid()).thenReturn(itemUid);
    when(fileItem.getResourceStoreRequest()).thenReturn(new ResourceStoreRequest("/some/path"));
    when(fileItem.getRepositoryItemAttributes()).thenReturn(attributes);
    when(fileItem.getItemContext()).thenReturn(new RequestContext());

  }
View Full Code Here

    // we need more mock responses as getResourceStoreRequest tries to gather
    // as much info as it can (from client, reference, baseUrl etc
    when(request.getClientInfo()).thenReturn(new ClientInfo());
    when(request.getOriginalRef()).thenReturn(reference);
    final ResourceStoreRequest rsr = underTest.getResourceStoreRequest(request, "/some/path");

    assertThat(rsr.getIfNoneMatch(), nullValue());
  }
View Full Code Here

    // we need more mock responses as getResourceStoreRequest tries to gather
    // as much info as it can (from client, reference, baseUrl etc
    when(request.getClientInfo()).thenReturn(new ClientInfo());
    when(request.getOriginalRef()).thenReturn(reference);
    final ResourceStoreRequest rsr = underTest.getResourceStoreRequest(request, "/some/path");

    assertThat(rsr.getIfNoneMatch(), nullValue());
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.proxy.ResourceStoreRequest

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.