Package org.sonatype.nexus.proxy

Examples of org.sonatype.nexus.proxy.RemoteStorageException


        else {
          return new URL(url.toExternalForm() + "&" + queryString);
        }
      }
      catch (MalformedURLException e) {
        throw new RemoteStorageException("Could not append query string \"" + queryString + "\" to url \""
            + url + "\"", e);
      }
    }
    return url;
  }
View Full Code Here


          || (StringUtils.isNotEmpty(oldRemoteUrl) && !oldRemoteUrl.equals(newRemoteUrl))) {
        this.remoteUrlChanged = true;
      }
    }
    else {
      throw new RemoteStorageException("No remote storage set on repository \"" + getName() + "\" (ID=\""
          + getId() + "\"), cannot set remoteUrl!");
    }
  }
View Full Code Here

    requests.add(new MockRequestRecord(repository, request, baseUrl));

    final String requestUrl = baseUrl.substring(0, baseUrl.length() - 1) + request.getRequestPath();

    if (downUrls.contains(baseUrl)) {
      throw new RemoteStorageException("Mock " + baseUrl + " is expected to be down.");
    }

    if (validUrls.contains(requestUrl)) {
      return new DefaultStorageFileItem(repository, request, true, false, new ByteArrayContentLocator(
          "Mock".getBytes(), "plain/text"));
View Full Code Here

          P2Constants.XMLPI_ARTIFACTS,
          context
      );
    }
    catch (final P2MetadataMergeException e) {
      throw new RemoteStorageException(e);
    }
    catch (IOException e) {
      throw new RemoteStorageException(e);
    }
  }
View Full Code Here

          P2Constants.XMLPI_CONTENT,
          context
      );
    }
    catch (final P2MetadataMergeException e) {
      throw new RemoteStorageException(e);
    }
    catch (final IOException e) {
      throw new RemoteStorageException(e);
    }
  }
View Full Code Here

        FileUtils.deleteDirectory(artifactRepositoryDir);
        artifactMappingsXmlFile.delete();
      }
    }
    catch (final XmlPullParserException e) {
      throw new RemoteStorageException(e);
    }
    catch (final UnsupportedStorageOperationException e) {
      throw new RemoteStorageException(e);
    }
    catch (final URISyntaxException e) {
      throw new RemoteStorageException(e);
    }
    catch (final IOException e) {
      throw new RemoteStorageException(e);
    }

    final Artifacts metadata = new Artifacts(dom);
    metadata.setRepositoryAttributes(repository.getName());
    final LinkedHashMap<String, String> properties = metadata.getProperties();
    final String mirrorsURL = properties.get(P2Constants.PROP_MIRRORS_URL);
    if (mirrorsURL != null) {
      context.put(CTX_MIRRORS_URL, mirrorsURL);
    }
    properties.remove(P2Constants.PROP_MIRRORS_URL);
    metadata.setProperties(properties);

    try {
      return createMetadataItems(
          repository,
          P2Constants.ARTIFACTS_XML,
          P2Constants.ARTIFACTS_JAR,
          metadata,
          P2Constants.XMLPI_ARTIFACTS,
          context
      );
    }
    catch (IOException e) {
      throw new RemoteStorageException(e);
    }
  }
View Full Code Here

      finally {
        FileUtils.deleteDirectory(metadataRepositoryDir);
      }
    }
    catch (final XmlPullParserException e) {
      throw new RemoteStorageException(e);
    }
    catch (final URISyntaxException e) {
      throw new RemoteStorageException(e);
    }
    catch (final IOException e) {
      throw new RemoteStorageException(e);
    }

    final Content metadata = new Content(dom);
    metadata.setRepositoryAttributes(repository.getName());
    final LinkedHashMap<String, String> properties = metadata.getProperties();
    properties.remove(P2Constants.PROP_MIRRORS_URL);
    metadata.setProperties(properties);

    try {
      return createMetadataItems(
          repository,
          P2Constants.CONTENT_XML,
          P2Constants.CONTENT_JAR,
          metadata,
          P2Constants.XMLPI_CONTENT,
          context
      );
    }
    catch (IOException e) {
      throw new RemoteStorageException(e);
    }
  }
View Full Code Here

    // does the remoteUrl have obrPath at the end?
    if (siteAndPath[1] == null) {
      // no, then require the obrPath to be set already
      if (!getExternalConfiguration(false).isObrPathSet()) {
        // it is not set, this is an error
        throw new RemoteStorageException(
            "Cannot set OBR URL! The OBR metadata path is not set, please specify a full URL including the OBR metadata file!");
      }
    }
    else {
      // yes, set it
View Full Code Here

TOP

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

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.