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

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


    }
    //disposeBuckMgmt ();
  }
  private static void AWSConnect() throws S3ServiceException {
    AWSCredentials awsCredentials = new AWSCredentials(wAccessKey.getText().toString(), wPrivateKey.getText().toString());
    s3Service = new RestS3Service(awsCredentials);
    myBuckets = s3Service.listAllBuckets();
 
View Full Code Here


   
  LogWriter log = LogWriter.getInstance();
   
  AWSCredentials awsCredentials = new AWSCredentials(_AKey,_PKey);
   
  S3Service s3Service = new RestS3Service(awsCredentials);
     
    S3Bucket[] myBuckets = s3Service.listAllBuckets();
    if(myBuckets != null){
      log.logDetailed(toString(),"Connected to S3 !");
      log.logDetailed(toString(), "_____________________________________");
    }
    log.logDetailed(toString(),"==>You have " + myBuckets.length + " Buckets in your S3" );
    log.logDetailed(toString(),"==>You will send the file [" + _FileNm + "] to the bucket [" + _S3Buck + "]" );
   
    String TargetBucket = _S3Buck;
     
    File fileData = new File(_FileNm);
    S3Object fileObject = new S3Object(fileData);
    log.logDetailed(toString(),"==>Hash value: " + fileObject.getMd5HashAsHex());
    log.logDetailed(toString(),"==>S3Object before upload: " + fileObject);
    log.logDetailed(toString(),"_____________________________________");

      // Upload the data objects.
    s3Service.putObject(TargetBucket, fileObject);
    log.logDetailed(toString(),"Sending file to S3 ...");
    log.logDetailed(toString(),"_____________________________________");
    log.logDetailed(toString(),"==>S3Object after upload: " + fileObject);
    log.logDetailed(toString(),"                                      ");
     
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

                                           "Secret Access Key must be specified " +
                                           "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

                                           "Secret Access Key must be specified " +
                                           "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) {
      handleException(e);
    }
    multipartEnabled =
        conf.getBoolean("fs.s3n.multipart.uploads.enabled", false);
View Full Code Here

        S3FileChooser.this.s3Tree.clean();

        try {
         
          //create S3Service
          S3Service s3Service = new RestS3Service(
              new AWSCredentials(
                  AmazonCredential.getInstance().getAwsAccessKeyId(),
                  AmazonCredential.getInstance().getAwsSecretAccessKey()));
         
          BucketsLoader bucketsLoader = new BucketsLoader(S3FileChooser.this.engine, S3FileChooser.this.dialog.getDialog());
View Full Code Here

   * @return S3Service
   */
  private S3Service getS3Service(){
    S3Service s3Service = null;
    try{
      s3Service = new RestS3Service(
          new AWSCredentials(
              AmazonCredential.getInstance().getAwsAccessKeyId(),
              AmazonCredential.getInstance().getAwsSecretAccessKey()));
    }catch(S3ServiceException s3ex){
      xBayaEngine.getErrorWindow().error(s3ex);
View Full Code Here

        log.info("Storing video stream: " + stream_id);
        IContext context = new Red5().getContext();
        Resource flv = context.getResource("streams/" + stream_id + ".flv");
        try {
            AWSCredentials credentials = new AWSCredentials(s3AccessKey, s3SecretKey);
            S3Service s3 = new RestS3Service(credentials);
            S3Bucket bucket = s3.getBucket("xubu");
            File file = flv.getFile();
            S3Object object = new S3Object(bucket, file);
            AccessControlList acl = s3.getBucketAcl(bucket);
            object.setAcl(acl);
            object.setKey("streams/" + stream_id + ".flv");
            object = s3.putObject(bucket, object);
            log.info("http://s3.amazonaws.com/" + bucket.getName() + "/" + object.getKey());
            file.delete();
            return true;
        } catch (IOException e) {
            log.error(e);
View Full Code Here

     * @return S3Service
     */
    private S3Service getS3Service() {
        S3Service s3Service = null;
        try {
            s3Service = new RestS3Service(new AWSCredentials(AmazonCredential.getInstance().getAwsAccessKeyId(),
                    AmazonCredential.getInstance().getAwsSecretAccessKey()));
        } catch (S3ServiceException s3ex) {
            xBayaEngine.getGUI().getErrorWindow().error(s3ex);
        }
        return s3Service;
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.