Package org.jets3t.service.impl.rest.httpclient

Examples of org.jets3t.service.impl.rest.httpclient.RestS3Service


      }
    }, Beacon.SCHEMA$, AvroFormat.BINARY, null);
    Properties p = new Properties();
    p.load(getClass().getResourceAsStream("creds.properties"));
    ProviderCredentials pc = new AWSCredentials(p.getProperty("AWS_ACCESS_KEY_ID"), p.getProperty("AWS_SECRET_ACCESS_KEY"));
    final RestS3Service s3 = new RestS3Service(pc);
    S3Object[] s3Objects = s3.listObjects("com.bagcheck.archive", "beacons/", null);
    ExecutorService es = Executors.newCachedThreadPool();
    List<Callable<Void>> callables = new ArrayList<Callable<Void>>();
    for (final S3Object s3Object : s3Objects) {
      if (!s3Object.getName().equals("beacons/")) {
        callables.add(new Callable<Void>() {
          @Override
          public Void call() throws Exception {
            S3Object object = s3.getObject(s3Object.getBucketName(), s3Object.getName());
            DataInputStream dis = new DataInputStream(new GZIPInputStream(object.getDataInputStream()));
            byte[] bytes = new byte[dis.readInt()];
            dis.readFully(bytes);
            byte[] valuebytes = new byte[1024];
            Schema writerSchema = Schema.parse(new ByteArrayInputStream(bytes));
View Full Code Here


                                           "as the password of a s3 URL, or by setting the " +
                                           "fs.s3.awsSecretAccessKey property.");        
      }
      AWSCredentials awsCredentials =
        new AWSCredentials(accessKey, secretAccessKey);
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
View Full Code Here

    s3Credentials.initialize(uri, conf);
    try {
      AWSCredentials awsCredentials =
        new AWSCredentials(s3Credentials.getAccessKey(),
            s3Credentials.getSecretAccessKey());
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
View Full Code Here

    s3Credentials.initialize(uri, conf);
    try {
      AWSCredentials awsCredentials =
        new AWSCredentials(s3Credentials.getAccessKey(),
            s3Credentials.getSecretAccessKey());
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
View Full Code Here

    s3Credentials.initialize(uri, conf);
    try {
      AWSCredentials awsCredentials =
        new AWSCredentials(s3Credentials.getAccessKey(),
            s3Credentials.getSecretAccessKey());
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      handleServiceException(e);
    }
    bucket = new S3Bucket(uri.getHost());
  }
View Full Code Here

    s3Credentials.initialize(uri, conf);
    try {
      AWSCredentials awsCredentials =
        new AWSCredentials(s3Credentials.getAccessKey(),
            s3Credentials.getSecretAccessKey());
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      handleS3ServiceException(e);
    }
    multipartEnabled =
        conf.getBoolean("fs.s3n.multipart.uploads.enabled", false);
View Full Code Here

    s3Credentials.initialize(uri, conf);
    try {
      AWSCredentials awsCredentials =
        new AWSCredentials(s3Credentials.getAccessKey(),
            s3Credentials.getSecretAccessKey());
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
View Full Code Here

                                           "as the password of a s3 URL, or by setting the " +
                                           "fs.s3.awsSecretAccessKey property.");        
      }
      AWSCredentials awsCredentials =
        new AWSCredentials(accessKey, secretAccessKey);
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
View Full Code Here

    s3Credentials.initialize(uri, conf);
    try {
      AWSCredentials awsCredentials =
        new AWSCredentials(s3Credentials.getAccessKey(),
            s3Credentials.getSecretAccessKey());
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
View Full Code Here

                                           "as the password of a s3 URL, or by setting the " +
                                           "fs.s3.awsSecretAccessKey property.");        
      }
      AWSCredentials awsCredentials =
        new AWSCredentials(accessKey, secretAccessKey);
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
View Full Code Here

TOP

Related Classes of org.jets3t.service.impl.rest.httpclient.RestS3Service

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.