use of com.pspace.ifs.ksan.gw.data.DataPutBucketWebsite in project ksan by infinistor.
the class PutBucketWebsite method process.
@Override
public void process() throws GWException {
logger.info(GWConstants.LOG_PUT_BUCKET_WEBSITE_START);
String bucket = s3Parameter.getBucketName();
initBucketInfo(bucket);
S3Bucket s3Bucket = new S3Bucket();
s3Bucket.setCors(getBucketInfo().getCors());
s3Bucket.setAccess(getBucketInfo().getAccess());
s3Parameter.setBucket(s3Bucket);
GWUtils.checkCors(s3Parameter);
if (s3Parameter.isPublicAccess() && GWUtils.isIgnorePublicAcls(s3Parameter)) {
throw new GWException(GWErrorCode.ACCESS_DENIED, s3Parameter);
}
checkGrantBucketOwner(s3Parameter.isPublicAccess(), String.valueOf(s3Parameter.getUser().getUserId()), GWConstants.GRANT_WRITE_ACP);
DataPutBucketWebsite dataPutBucketWebsite = new DataPutBucketWebsite(s3Parameter);
dataPutBucketWebsite.extract();
String webXml = dataPutBucketWebsite.getWebsiteXml();
updateBucketWeb(bucket, webXml);
s3Parameter.getResponse().setStatus(HttpServletResponse.SC_OK);
}
Aggregations