Package org.jets3t.service

Examples of org.jets3t.service.Jets3tProperties



    protected RestStorageService getStorageService(ProviderCredentials credentials,
        String endpointHostname) throws ServiceException
    {
        Jets3tProperties properties = new Jets3tProperties();
        properties.setProperty("s3service.s3-endpoint", endpointHostname);
        return getStorageService(credentials, properties);
    }
View Full Code Here


            objDetails = s3Service.getObjectDetails(bucketName, object.getKey());
            assertEquals(S3Object.SERVER_SIDE_ENCRYPTION__AES256, objDetails.getMetadata("server-side-encryption"));
            assertEquals(S3Object.SERVER_SIDE_ENCRYPTION__AES256, objDetails.getServerSideEncryptionAlgorithm());

            // Create an encrypted object, per default algorithm set in service properties
            Jets3tProperties properties = new Jets3tProperties();
            properties.setProperty("s3service.server-side-encryption",
                S3Object.SERVER_SIDE_ENCRYPTION__AES256);
            s3Service = (S3Service) getStorageService(getCredentials(), properties);
            object = new S3Object("encrypted-object-as-default", "Some data");
            s3Service.putObject(bucketName, object);
            // Confirm object is encrypted
View Full Code Here

            testProperties.getProperty("gsservice.secretkey"));
    }

    @Override
    protected RestStorageService getStorageService(ProviderCredentials credentials) throws ServiceException {
        Jets3tProperties properties = new Jets3tProperties();
        properties.setProperty("s3service.s3-endpoint", Constants.GS_DEFAULT_HOSTNAME);
        return new RestS3Service(credentials, null, null, properties);
    }
View Full Code Here

            File local3 = File.createTempFile("three", " ثلاثة.txt", parentDir2);
            String local1Path = parentDir1.getName() + File.separator + local1.getName();
            String local2Path = parentDir1.getName() + File.separator + local2.getName();
            String local3Path = parentDir2.getName() + File.separator + local3.getName();

            FileComparer comparer = new FileComparer(new Jets3tProperties());
            // Build a file map of local files
            Map<String, String> objectKeyToFilepathMap = comparer.buildObjectKeyToFilepathMap(
                new File[] {parentDir1, parentDir2}, "", true);
            assertEquals(5, objectKeyToFilepathMap.size());
            assertTrue(objectKeyToFilepathMap.keySet().contains(local1Path));
View Full Code Here

        protected AbstractConnPool createConnectionPool(final HttpParams params) {
            // Set the maximum connections per host for the HTTP connection manager,
            // *and* also set the maximum number of total connections (new in 0.7.1).
            // The max connections per host setting is made the same value as the max
            // global connections if there is no per-host property.
            Jets3tProperties props = (Jets3tProperties) params.getParameter(
                    Jets3tProperties.JETS3T_PROPERTIES_ID);
            int maxConn = 20;
            int maxConnectionsPerHost = 0;
            if (props != null) {
                maxConn = props.getIntProperty("httpclient.max-connections", 20);
                maxConnectionsPerHost = props.getIntProperty(
                        "httpclient.max-connections-per-host",
                        0);
            }
            if (maxConnectionsPerHost == 0) {
                maxConnectionsPerHost = maxConn;
            }
            connPerRoute.setDefaultMaxPerRoute(maxConnectionsPerHost);
            return new ConnPoolByRoute(connOperator, connPerRoute, maxConn,props.getLongProperty("httpclient.connection.ttl", -1L), TimeUnit.MILLISECONDS);
        }
View Full Code Here

      cal.add(Calendar.HOUR, 24);
      expiryDate = cal.getTime();
     
      try {
        java.io.InputStream jets3tPStream = this.getClass().getResourceAsStream("jets3t.properties");
        Jets3tProperties props = Jets3tProperties.getInstance(jets3tPStream, "jets3t.properties");
        props.loadAndReplaceProperties(jets3tPStream, "jets3t.properties");
      } catch (Exception e) {
        log.severe("unable to load: "+ "jets3t.properties");
        log.severe(""+e);
      }
     
View Full Code Here

    protected void initialize() {
        if (mpUtils == null) { // not injected
            mpUtils = new MultipartUtils(maxPartSize);
        }
        try {
            Jets3tProperties properties = new Jets3tProperties();
            properties.setProperty("s3service.s3-endpoint", s3Endpoint);
            if (credentialsProvider.getCredentials() instanceof AWSSessionCredentials) {
                s3Service = new RestS3Service(
                        new AWSSessionCredentialsAdapter(credentialsProvider),
                        null, null, properties);
            } else {
View Full Code Here

    @Override
    public void start() throws Exception {
        try {
            if (s3Service == null) {
                Jets3tProperties properties = new Jets3tProperties();
                properties.setProperty("s3service.s3-endpoint", s3Endpoint);
                if (credentialsProvider.getCredentials() instanceof AWSSessionCredentials) {
                    s3Service = new RestS3Service(
                            new AWSSessionCredentialsAdapter(credentialsProvider),
                            null, null, properties);
                } else {
View Full Code Here

TOP

Related Classes of org.jets3t.service.Jets3tProperties

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.