com.upplication.s3fs.AmazonS3Client Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nxf-s3fs Show documentation
Show all versions of nxf-s3fs Show documentation
A JSR-203 complaint file system provider for Amazon S3 storage
/*
* Copyright (c) 2013-2015, Centre for Genomic Regulation (CRG).
* Copyright (c) 2013-2015, Paolo Di Tommaso and the respective authors.
*
* This file is part of 'Nextflow'.
*
* Nextflow is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Nextflow is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Nextflow. If not, see .
*/
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Javier Arnáiz @arnaix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.upplication.s3fs;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.model.*;
import java.io.File;
import java.io.InputStream;
import java.util.List;
/**
* Client Amazon S3
* @see com.amazonaws.services.s3.AmazonS3Client
*/
public class AmazonS3Client {
private AmazonS3 client;
public AmazonS3Client(AmazonS3 client){
this.client = client;
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#listBuckets()
*/
public List listBuckets() {
return client.listBuckets();
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#listObjects(ListObjectsRequest)
*/
public ObjectListing listObjects(ListObjectsRequest request) {
return client.listObjects(request);
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#getObject(String, String)
*/
public S3Object getObject(String bucketName, String key) {
return client.getObject(bucketName, key);
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#putObject(String, String, File)
*/
public PutObjectResult putObject(String bucket, String key, File file) {
return client.putObject(bucket, key, file);
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#putObject(String, String, java.io.InputStream, ObjectMetadata)
*/
public PutObjectResult putObject(String bucket, String keyName,
InputStream inputStream, ObjectMetadata metadata) {
return client.putObject(bucket, keyName, inputStream, metadata);
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#deleteObject(String, String)
*/
public void deleteObject(String bucket, String key) {
client.deleteObject(bucket, key);
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#copyObject(String, String, String, String)
*/
public CopyObjectResult copyObject(String sourceBucketName, String sourceKey, String destinationBucketName,
String destinationKey) {
return client.copyObject(sourceBucketName, sourceKey, destinationBucketName, destinationKey);
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#getBucketAcl(String)
*/
public AccessControlList getBucketAcl(String bucket) {
return client.getBucketAcl(bucket);
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#getS3AccountOwner()
*/
public Owner getS3AccountOwner() {
return client.getS3AccountOwner();
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#setEndpoint(String)
*/
public void setEndpoint(String endpoint) {
client.setEndpoint(endpoint);
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#getObjectAcl(String, String)
*/
public AccessControlList getObjectAcl(String bucketName, String key) {
return client.getObjectAcl(bucketName, key);
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#getObjectMetadata(String, String)
*/
public ObjectMetadata getObjectMetadata(String bucketName, String key) {
return client.getObjectMetadata(bucketName, key);
}
/**
* @see com.amazonaws.services.s3.AmazonS3Client#listNextBatchOfObjects(com.amazonaws.services.s3.model.ObjectListing)
*/
public ObjectListing listNextBatchOfObjects(ObjectListing objectListing) {
return client.listNextBatchOfObjects(objectListing);
}
}