Package org.sonatype.nexus.proxy

Examples of org.sonatype.nexus.proxy.ResourceStoreRequest


      final DefaultWalkerContext context = new DefaultWalkerContext(this, request);
      final Collection<String> nfcPaths = getNotFoundCache().listKeysInCache();

      for (String nfcPath : nfcPaths) {
        final DefaultStorageNotFoundItem nfcItem =
            new DefaultStorageNotFoundItem(this, new ResourceStoreRequest(nfcPath));

        if (filter.shouldProcess(context, nfcItem)) {
          parentOMatic.addAndMarkPath(nfcPath);
        }
      }
View Full Code Here


      throw new RepositoryNotAvailableException(this);
    }

    maintainNotFoundCache(coll.getResourceStoreRequest());

    Collection<StorageItem> items = doListItems(new ResourceStoreRequest(coll));

    return items;
  }
View Full Code Here

  @Override
  public void purge(final Repository repository, final long age)
      throws IOException
  {
    ResourceStoreRequest req = new ResourceStoreRequest(getTrashPath(repository, RepositoryItemUid.PATH_ROOT));
    // NEXUS-4642 shall not delete the directory, since causes a problem if this has been symlinked to another
    // directory.
    // walker and walk and changes for age
    if (repository.getLocalStorage().containsItem(repository, req)) {
      req.setRequestGroupLocalOnly(true);
      req.setRequestLocalOnly(true);
      DefaultWalkerContext ctx = new DefaultWalkerContext(repository, req, new AffirmativeStoreWalkerFilter());
      ctx.getProcessors().add(new WastebasketWalker(age));
      getWalker().walk(ctx);
    }
  }
View Full Code Here

                      final ResourceStoreRequest request, final DeleteOperation type)
      throws LocalStorageException
  {
    try {
      if (DeleteOperation.MOVE_TO_TRASH.equals(type)) {
        ResourceStoreRequest trashed =
            new ResourceStoreRequest(getTrashPath(repository, request.getRequestPath()));
        ls.moveItem(repository, request, trashed);
      }

      ls.shredItem(repository, request);
    }
View Full Code Here

  public boolean undelete(final LocalRepositoryStorage ls, final Repository repository,
                          final ResourceStoreRequest request)
      throws LocalStorageException
  {
    try {
      ResourceStoreRequest trashed =
          new ResourceStoreRequest(getTrashPath(repository, request.getRequestPath()));
      ResourceStoreRequest untrashed =
          new ResourceStoreRequest(getUnTrashPath(repository, request.getRequestPath()));

      if (!ls.containsItem(repository, untrashed)) {
        ls.moveItem(repository, trashed, untrashed);
        return true;
      }
View Full Code Here

    private static ResourceStoreRequest clone(ResourceStoreRequest request) {
      if (request == null) {
        return null;
      }
      ResourceStoreRequest result =
          new ResourceStoreRequest(request.getRequestPath(), request.isRequestLocalOnly(),
              request.isRequestRemoteOnly());
      // only requestPath is used at the moment
      return result;
    }
View Full Code Here

      }

      try {
        final Repository repository = uid.getRepository();

        final ResourceStoreRequest request =
            new ResourceStoreRequest(getAttributePath(repository, uid.getPath()));

        repository.getLocalStorage().deleteItem(repository, request);

        return true;
      }
View Full Code Here

        marshaller.marshal(attributes, bos);

        final Repository repository = uid.getRepository();

        final DefaultStorageFileItem attributeItem =
            new DefaultStorageFileItem(repository, new ResourceStoreRequest(getAttributePath(repository,
                uid.getPath())), true, true, new ByteArrayContentLocator(bos.toByteArray(), "text/xml"));

        repository.getLocalStorage().storeItem(repository, attributeItem);
      }
      catch (UnsupportedStorageOperationException ex) {
View Full Code Here

    try {
      final Repository repository = uid.getRepository();

      AbstractStorageItem attributeItemCandidate =
          repository.getLocalStorage().retrieveItem(repository,
              new ResourceStoreRequest(getAttributePath(repository, uid.getPath())));

      if (attributeItemCandidate instanceof StorageFileItem) {
        StorageFileItem attributeItem = (StorageFileItem) attributeItemCandidate;

        if (attributeItem.getLength() == 0) {
View Full Code Here

  @Override
  public boolean exists(String path)
      throws IOException
  {
    return repository.getLocalStorage().containsItem(repository, new ResourceStoreRequest(path, true));
  }
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.