clean code

master
roberto cirillo 3 years ago
parent abc78f1803
commit e2281aff41

@ -27,43 +27,16 @@
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-wrapper</artifactId>
<version>[2.5.3-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<version>[3.0.0-SNAPSHOT, 4.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-core</artifactId>
<version>[2.10.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<version>[3.0.0-SNAPSHOT, 4.0.0-SNAPSHOT)</version>
</dependency>
<!-- <dependency> -->
<!-- <groupId>software.amazon.awssdk</groupId> -->
<!-- <artifactId>dynamodb</artifactId> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>com.amazonaws</groupId> -->
<!-- <artifactId>aws-lambda-java-core</artifactId> -->
<!-- <version>1.2.0</version> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>software.amazon.awssdk</groupId> -->
<!-- <artifactId>aws-sdk-java</artifactId> -->
<!-- <version>2.5.31</version> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>com.instantor.amazon</groupId> -->
<!-- <artifactId>S3Client</artifactId> -->
<!-- <version>1.0.2</version> -->
<!-- </dependency> -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
</dependency>
<!-- <dependency> -->
<!-- <groupId>software.amazon.awssdk</groupId> -->
<!-- <artifactId>kms</artifactId> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>software.amazon.awssdk</groupId> -->
<!-- <artifactId>s3control</artifactId> -->
<!-- </dependency> -->
</dependencies>
</project>

@ -42,13 +42,6 @@ public class S3PluginManager extends TransportManager {
S3Client s3;
private Logger logger = LoggerFactory.getLogger(S3PluginManager.class);
//
//// THE FOLLOWING FIELDS SHOULD BE RETRIEVED FROM SERVICEENDPOINT
// static final String ACCESS_KEY="UXMKEBMZBDROS5K9HREG";
// static final String SECRET_ACCESS_KEY="0Mqu8gmzcZ09wuqqKZwNmuS5bYC549MlZhvfgv6W";
// Region region = Region.EU_NORTH_1;
//// final String END_POINT = "https://s3.wasabisys.com";
// static String bucket="g3-test1data"; // gcube-test;//"gcube-home-test-access";
private Region region;
private String token;
@ -98,8 +91,6 @@ public class S3PluginManager extends TransportManager {
if (!BucketOperator.isBucket(s3, bucketName))
BucketOperator.createBucketWaiter(s3, bucketName, region);
File file= new File(upload.getResource().getLocalPath());
// int hashcode=BucketOperator.getInstance(s3).putObject(bucketName, Utils.convertToS3Format(upload.getResource().getRemotePath()), file, upload.isReplaceOption()).hashCode();
// return hashcode+"";
return BucketOperator.getInstance(s3).putObject(bucketName, Utils.convertToS3Format(upload.getResource().getRemotePath()), file, upload.isReplaceOption());
}

Loading…
Cancel
Save