private static void setS3Attrs(Resource res,Object acl,int storage) throws PageException {
String scheme = res.getResourceProvider().getScheme();
if("s3".equalsIgnoreCase(scheme)){
S3Resource s3r=(S3Resource) res;
if(acl!=null){
try {
// old way
if(Decision.isString(acl)) {
if(Decision.isInteger(acl)) s3r.setACL(Caster.toIntValue(acl));
else s3r.setACL(S3.toIntACL(Caster.toString(acl)));
}
// new way
else {
StoreSetACL.invoke(s3r, acl);
}
} catch (IOException e) {
throw Caster.toPageException(e);
}
}
if(storage!=S3Constants.STORAGE_UNKNOW) s3r.setStorage(storage);
}
}