Java 类com.amazonaws.mobileconnectors.s3.transfermanager.TransferManager 实例源码

项目:upman    文件:S3Uploader.java   
public static void uploadToS3(TransferManager transferManager, final File file, final FileProgressListener fileProgressListener) throws InterruptedException {
    PutObjectRequest putObjectRequest = new PutObjectRequest("car-classifieds", file.getName(), file)
            .withCannedAcl(CannedAccessControlList.PublicRead);
    final Upload upload = transferManager.upload(putObjectRequest);
    upload.addProgressListener(new ProgressListener() {
        @Override
        public void progressChanged(ProgressEvent progressEvent) {
            fileProgressListener.onProgressChanged(progressEvent.getBytesTransferred());
            if (progressEvent.getEventCode() == ProgressEvent.COMPLETED_EVENT_CODE) {
                fileProgressListener.onCompleteUpload();
            }
            if (progressEvent.getEventCode() == com.amazonaws.event.ProgressEvent.STARTED_EVENT_CODE) {
                fileProgressListener.onStartUpload();
            }
            if (progressEvent.getEventCode() == com.amazonaws.event.ProgressEvent.FAILED_EVENT_CODE) {
                fileProgressListener.onFailedUpload();
            }
        }
    });
}
项目:snake-game-aws    文件:AWSClientManager.java   
public static void init(Context context)
{
       provider = new CognitoCachingCredentialsProvider(context, 
               AWS_ACCOUNT_ID, COGNITO_POOL_ID, COGNTIO_ROLE_UNAUTH,
               COGNITO_ROLE_AUTH, Regions.US_EAST_1);

       //initialize the clients
       cognitosync = new CognitoSyncManager(context, Regions.US_EAST_1, provider);        
    manager = new TransferManager(provider);
    ddb = new AmazonDynamoDBClient(provider);
    //ddbmapper = new DynamoDBMapper(ddb);
    analytics = MobileAnalyticsManager.getOrCreateInstance(context, MOBILE_ANALYTICS_APP_ID, Regions.US_EAST_1, provider);
    kinesis = new KinesisRecorder(context.getDir(KINESIS_DIRECTORY_NAME, 0), Regions.US_EAST_1, provider);
    lambda = new LambdaInvokerFactory(context, Regions.US_WEST_2, provider);
}
项目:upman    文件:S3Uploader.java   
public static void uploadToS3(TransferManager transferManager, final File file) throws InterruptedException {
    PutObjectRequest putObjectRequest = new PutObjectRequest("car-classifieds", file.getName(), file)
            .withCannedAcl(CannedAccessControlList.PublicRead);
    final Upload upload = transferManager.upload(putObjectRequest);
    upload.addProgressListener(new ProgressListener() {
        @Override
        public void progressChanged(ProgressEvent progressEvent) {
            if (progressEvent.getEventCode() == ProgressEvent.COMPLETED_EVENT_CODE) {

            }
        }
    });
}
项目:upman    文件:S3Uploader.java   
public static TransferManager getTransferManager(Context context) {
    CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider(
            context,
            "us-east-1:c2432cb5-55e1-42ec-a12f-4be2bc8abd9a",
            Regions.US_EAST_1
    );
    TransferManager transferManager = new TransferManager(credentialsProvider);
    return transferManager;
}
项目:kickflip-android-sdk    文件:S3BroadcastManager.java   
public S3BroadcastManager(Broadcaster broadcaster, AWSCredentials creds) {

        // XXX - Need to determine what's going wrong with MD5 computation
        System.setProperty("com.amazonaws.services.s3.disableGetObjectMD5Validation", "true");

        mTransferManager = new TransferManager(creds);
        mBroadcaster = broadcaster;
        mQueue = new LinkedBlockingQueue<>();
        mInterceptors = new HashSet<>();
        new Thread(this).start();
    }
项目:aws-mobile-self-paced-labs-samples    文件:AWSClientManager.java   
public static void init(Context context)
{
       provider = new CognitoCachingCredentialsProvider(context, 
               AWS_ACCOUNT_ID, COGNITO_POOL_ID, COGNTIO_ROLE_UNAUTH,
               COGNITO_ROLE_AUTH, Regions.US_EAST_1);

       //initialize the Cognito Sync Client

       //initialize the Other Clients
    manager = new TransferManager(provider);
    analytics = MobileAnalyticsManager.getOrCreateInstance(context, "App_ID_Here", Regions.US_EAST_1, provider);

}
项目:snake-game-aws    文件:AWSClientManager.java   
public static TransferManager getManager() {
    if (manager == null) {
           throw new IllegalStateException("client not initialized yet");
       }
    return manager;
}
项目:aws-mobile-self-paced-labs-samples    文件:AWSClientManager.java   
public static TransferManager getManager() {
    if (manager == null) {
           throw new IllegalStateException("client not initialized yet");
       }
    return manager;
}