Package org.sonatype.nexus.proxy

Examples of org.sonatype.nexus.proxy.ItemNotFoundException$ItemNotFoundInRepositoryReason


            item =
                (StorageFileItem) repository.getRemoteStorage()
                    .retrieveItem(repository, req, repository.getRemoteUrl());
          }
          else {
            throw new ItemNotFoundException(req, repository);
          }

          return item.getInputStream();
        }
        catch (ItemNotFoundException ex) {
View Full Code Here


      Object result = viewProviders.get(key).retrieveView(store, request, item, req);

      // make sure we have valid content
      if (result == null) {
        throw new ItemNotFoundException(reasonFor(request,
            "View provider keyed \"%s\" did not provide content.", key));
      }
      else {
        return result;
      }
View Full Code Here

      return new DefaultStorageFileItem(repository, request, true, false, new ByteArrayContentLocator(
          "Mock".getBytes(), "plain/text"));
    }

    // else
    throw new ItemNotFoundException(request);
  }
View Full Code Here

    final String baseUrl = getBaseMirrorsURL(url);
    final AbstractStorageItem mirrorsItem = getRemoteStorage().retrieveItem(this, request, baseUrl);
    if (mirrorsItem instanceof StorageFileItem) {
      return (StorageFileItem) mirrorsItem;
    }
    throw new ItemNotFoundException(
        ItemNotFoundException.reasonFor(request, this, "URL %s does not contain valid mirrors", mirrorsURL));
  }
View Full Code Here

    final String requestPath = request.getRequestPath();
    log.debug("Repository " + getId() + ": doRetrieveItem:" + requestPath);

    if (P2Constants.ARTIFACT_MAPPINGS_XML.equals(requestPath)) {
      if (getLocalStorage() == null) {
        throw new ItemNotFoundException(request);
      }

      final StorageItem item = getLocalStorage().retrieveItem(this, request);
      return item;
    }
View Full Code Here

        try {
          // this will trigger a merge if group yum metadata is dirty and will wait for the task to finish
          yum.getYumRepository();
        }
        catch (Exception e) {
          throw new ItemNotFoundException(reasonFor(request, repository, e.getMessage()));
        }
      }
    }
  }
View Full Code Here

          itemLock.lock(Action.read);
        }
      }

      // we explicitly do not serve any other metadata files
      throw new ItemNotFoundException(request, repository);
    }
    finally {
      // release repo read lock we initially acquired
      repoLock.unlock();
View Full Code Here

  {
    if (repository.getLocalStorage() != null) {
      final AbstractStorageItem localItem = repository.getLocalStorage().retrieveItem(repository, request);
      return localItem;
    }
    throw new ItemNotFoundException(request, repository);
  }
View Full Code Here

      throws IllegalOperationException, ItemNotFoundException, StorageException
  {
    fixRemoteUrl(request);

    if (P2Constants.SITE_XML.equals(request.getRequestPath())) {
      throw new ItemNotFoundException(request, this);
    }

    if (AbstractP2MetadataSource.isP2MetadataItem(request.getRequestPath())) {
      if (!isItemValid(P2Constants.SITE_XML)) {
        UpdateSiteMirrorTask.submit(scheduler, this, false);
View Full Code Here

        }
      }

      if (kind == null) {
        // unknown explodedPath[0]
        throw new ItemNotFoundException(
            reasonFor(
                request,
                "Repository kind '" + explodedPath[0] + "' is unknown"));
      }

      result.setStrippedPrefix(PathUtils.concatPaths(explodedPath[0]));
    }

    if (explodedPath.length >= 2) {
      // we have repoId information in path
      Repository repository = null;

      try {
        repository = getRepositoryForPathPrefixOrId(explodedPath[1], kind);
        // explodedPath[1] is not _always_ ID anymore! It is PathPrefix _or_ ID! NEXUS-1710
        // repository = repositoryRegistry.getRepositoryWithFacet( explodedPath[1], kind );

        if (!repository.isExposed()) {
          // this is not the main facet or the repo is not exposed
          throw new ItemNotFoundException(reasonFor(request, "Repository %s exists but is not exposed.",
              RepositoryStringUtils.getHumanizedNameString(repository)));
        }
      }
      catch (NoSuchRepositoryException e) {
        // obviously, the repoId (explodedPath[1]) points to some nonexistent repoID
        throw new ItemNotFoundException(reasonFor(request, e.getMessage()), e);
      }

      result.setStrippedPrefix(PathUtils.concatPaths(explodedPath[0], explodedPath[1]));

      result.setTargetedRepository(repository);
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.proxy.ItemNotFoundException$ItemNotFoundInRepositoryReason

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.