Examples of ValidationErrorsException


Examples of org.sonatype.siesta.ValidationErrorsException

      if (actualPort != null) {
        try {
          actualPortInt = Integer.valueOf(actualPort);
        }
        catch (NumberFormatException e) {
          throw new ValidationErrorsException("port", "Port must be an integer");
        }
      }

      Certificate[] chain;
      try {
        chain = retrieveCertificates(remoteStorageContext, actualHost, actualPortInt, actualProtocolHint);
      }
      catch (Exception e) {
        String errorMessage = e.getMessage();
        if (e instanceof UnknownHostException) {
          errorMessage = "Unknown host '" + actualHost + "'";
        }
        throw new NotFoundException(errorMessage);
      }
      if (chain == null || chain.length == 0) {
        throw new NotFoundException(
            "Could not retrieve an SSL certificate from " + actualHost + ":" + actualPortInt
        );
      }

      return asCertificateXO(chain[0], isInNexusSSLTrustStore(chain[0]));
    }
    throw new ValidationErrorsException("One of repositoryId or host/port should be specified");
  }
View Full Code Here

Examples of org.sonatype.siesta.ValidationErrorsException

    try {
      final Certificate certificate = decodePEMFormattedCertificate(pem.getValue());
      return asCertificateXO(certificate, isInNexusSSLTrustStore(certificate));
    }
    catch (CertificateParsingException e) {
      throw new ValidationErrorsException("pem", "Invalid PEM formatted certificate");
    }
  }
View Full Code Here

Examples of org.sonatype.siesta.ValidationErrorsException

      final Certificate certificate = CertificateUtil.decodePEMFormattedCertificate(pem.getValue());
      trustStore.importTrustCertificate(certificate, calculateFingerprint(certificate));
      return asCertificateXO(certificate, true);
    }
    catch (CertificateParsingException e) {
      throw new ValidationErrorsException("pem", "Invalid PEM formatted certificate");
    }
  }
View Full Code Here

Examples of org.sonatype.sisu.siesta.common.validation.ValidationErrorsException

  {
    try {
      final ClientResponse response = callable.call();
      response.bufferEntity();
      if (isValidationError(response)) {
        throw new ValidationErrorsException()
            .withErrors(response.getEntity(new GenericType<List<ValidationErrorXO>>()
            {
            }));
      }
      if (isError(response)) {
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.