Package org.jets3t.service

Examples of org.jets3t.service.ServiceException


        result = new EOFException(FSExceptionMessages.CANNOT_SEEK_PAST_EOF);
      } else {
        result = new S3Exception(se);
      }
    } else if (thrown instanceof ServiceException) {
      ServiceException se = (ServiceException) thrown;
      LOG.debug("S3ServiceException: {}: {} : {}",
          se.getErrorCode(), se.toString(), se, se);
      result = new S3Exception(se);
    } else if (thrown instanceof IOException) {
      result = (IOException) thrown;
    } else {
      // here there is no exception derived yet.
View Full Code Here


            if (automaticDecrypt
                && object.containsMetadata(Constants.METADATA_JETS3T_CRYPTO_ALGORITHM))
            {
                // Object is encrypted.
                if (encryptionPassword == null) {
                    throw new ServiceException(
                        "One or more objects are encrypted, and cannot be downloaded unless "
                        + " the encyption password is provided");
                }

                String algorithm = (String) object.getMetadata(
View Full Code Here

            if (automaticDecrypt
                && object.containsMetadata(Constants.METADATA_JETS3T_CRYPTO_ALGORITHM))
            {
                // Object is encrypted.
                if (encryptionPassword == null) {
                    throw new ServiceException(
                        "One or more objects are encrypted, and cannot be downloaded unless "
                        + " the encyption password is provided");
                }

                String algorithm = (String) object.getMetadata(
View Full Code Here

        int maxThreadCount = this.storageService.getJetS3tProperties()
            .getIntProperty("threaded-service.max-thread-count", 2);
        int maxConnectionCount = this.storageService.getJetS3tProperties()
            .getIntProperty("httpclient.max-connections", 20);
        if (maxConnectionCount < maxThreadCount) {
            throw new ServiceException(
                "Insufficient connections available (httpclient.max-connections="
                + maxConnectionCount + ") to run (threaded-service.max-thread-count="
                + maxThreadCount + ") simultaneous threads - please adjust JetS3t properties");
        }
        if (maxConnectionCount < adminMaxThreadCount) {
            throw new ServiceException(
                "Insufficient connections available (httpclient.max-connections="
                + maxConnectionCount + ") to run (threaded-service.admin-max-thread-count="
                + adminMaxThreadCount
                + ") simultaneous admin threads - please adjust JetS3t properties");
        }
View Full Code Here

            String fullMessage = message
                + ": PartNumber=" + partNumber
                + ", MinSizeAllowed=" + minSizeAllowed
                + ", ProposedSize=" + proposedSize
                + ", ETag=" + etag;
            ServiceException e = new ServiceException(fullMessage);
            e.setErrorCode(code);
            e.setErrorMessage(message);
            e.setErrorHostId(hostId);
            e.setErrorRequestId(requestId);
            return e;
        }
View Full Code Here

     * @param acl Permissions
     * @throws ServiceException Service error
     */
    public void putBucketAcl(String bucketName, GSAccessControlList acl) throws ServiceException {
        if (acl == null) {
            throw new ServiceException("The bucket '" + bucketName +
                "' does not include ACL information");
        }
        putBucketAclImpl(bucketName, acl);
    }
View Full Code Here

            OAuth2Tokens tokens;
            try {
                tokens = ((OAuth2Credentials)getProviderCredentials()).getOAuth2Tokens();
            }
            catch(IOException e) {
                throw new ServiceException("Failure retrieving OAuth2 tokens", e);
            }
            if (tokens == null) {
                throw new ServiceException(
                        "Cannot authenticate using OAuth2 until initial tokens are provided"
                                + ", i.e. via setOAuth2Tokens()");
            }
            log.debug("Authorizing service request with OAuth2 access token: "
                    + tokens.getAccessToken());
View Full Code Here

    public XMLBuilder toXMLBuilder() throws ServiceException, ParserConfigurationException,
        FactoryConfigurationError, TransformerException
    {
        if (owner == null) {
            throw new ServiceException("Invalid AccessControlList: missing an owner");
        }
        if (owner.getId() == null || "".equals(owner.getId())) {
            throw new ServiceException("Invalid AccessControlList: missing owner ID");
        }
        XMLBuilder builder = XMLBuilder.create("AccessControlPolicy")
            .attr("xmlns", Constants.XML_NAMESPACE)
            .elem("Owner")
                .elem("ID").text(owner.getId()).up()
View Full Code Here

     */
    public String toXml() throws ServiceException {
        try {
            return toXMLBuilder().asString();
        } catch (Exception e) {
            throw new ServiceException("Failed to build XML document for ACL", e);
        }
    }
View Full Code Here

            // Add encoded authorization to connection as HTTP Authorization header.
            String authorizationString = getSignatureIdentifier() + " "
                    + getProviderCredentials().getAccessKey() + ":" + signedCanonical;
            httpMethod.setHeader("Authorization", authorizationString);
        } else {
            throw new ServiceException("Unsupported property setting for "
                + "storage-service.request-signature-version \""
                + requestSignatureVersion + "\", must be one of: "
                + "\"AWS2\" (legacy), \"AWS4-HMAC-SHA256\"");
        }
    }
View Full Code Here

TOP

Related Classes of org.jets3t.service.ServiceException

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.