use of com.emc.object.s3.bean.PutObjectResult in project pravega by pravega.
the class S3FileSystemImpl method putObject.
@Override
public PutObjectResult putObject(PutObjectRequest request) {
if (request.getObjectMetadata() != null) {
request.setObjectMetadata(null);
}
try {
Path path = Paths.get(this.baseDir, request.getBucketName(), request.getKey());
Files.createDirectories(path.getParent());
Files.createFile(path);
} catch (IOException e) {
throw new S3Exception(e.getMessage(), 0, e);
}
PutObjectResult retVal = new PutObjectResult();
if (request.getAcl() != null) {
long size = 0;
if (request.getRange() != null) {
size = request.getRange().getLast() + 1;
}
aclMap.putIfAbsent(request.getKey(), new AclSize(request.getAcl(), size));
}
return retVal;
}
use of com.emc.object.s3.bean.PutObjectResult in project pravega by pravega.
the class S3ProxyImpl method putObject.
@Override
public PutObjectResult putObject(PutObjectRequest request) {
S3ObjectMetadata metadata = request.getObjectMetadata();
if (request.getObjectMetadata() != null) {
request.setObjectMetadata(null);
}
PutObjectResult retVal = client.putObject(request);
if (request.getAcl() != null) {
long size = 0;
if (request.getRange() != null) {
size = request.getRange().getLast() - 1;
}
aclMap.put(request.getKey(), new AclSize(request.getAcl(), size));
}
return retVal;
}
Aggregations