Package railo.commons.io.res.type.s3

Examples of railo.commons.io.res.type.s3.S3Resource


  private static Object toArrayStruct(List<AccessControl> accessControlList) throws S3Exception {
    Array arr=new ArrayImpl();
    String type;
    Struct sct;
    AccessControl ac;
    Iterator<AccessControl> it = accessControlList.iterator();
    while(it.hasNext()){
      ac=it.next();
      arr.appendEL(sct=new StructImpl());
      sct.setEL(KeyConstants._id, ac.getId());
      sct.setEL(PERMISSION, ac.getPermission());
     
      type = AccessControl.toType(ac.getType());
      if("Group".equalsIgnoreCase(type))        
        setGroup(sct,ac);
      else if("CanonicalUser".equalsIgnoreCase(type))
        sct.setEL(DISPLAY_NAME, ac.getDisplayName());
      else
        sct.setEL(KeyConstants._email, ac.getId());
    }
    return arr;
  }
View Full Code Here


    }
  }

  public static String _call(PageContext pc , String url, Object objACL) throws PageException, IOException {
    S3Resource res=toS3Resource(pc,url,"StoreAddACL");
    AccessControlPolicy acp = res.getAccessControlPolicy();
   
    List<AccessControl> acl = acp.getAccessControlList();
    List<AccessControl> newACL = AccessControl.toAccessControlList(objACL);
   
    Iterator<AccessControl> it = newACL.iterator();
    while(it.hasNext()){
      acl.add(it.next());
View Full Code Here

    invoke(res, objACL);
    return null;
  }
 
  public static void invoke(S3Resource res, Object objACL) throws PageException, IOException {
    AccessControlPolicy acp = res.getAccessControlPolicy();
    List<AccessControl> acl = AccessControl.toAccessControlList(objACL);
    AccessControlPolicy.removeDuplicates(acl);
    acp.setAccessControlList(acl);
    res.setAccessControlPolicy(acp);
  }
View Full Code Here

 
  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);
    }
  }
View Full Code Here

  public static final Collection.Key PERMISSION = KeyImpl.intern("permission");
 
 
  public static Object call(PageContext pc , String url) throws PageException {
       
    S3Resource res=toS3Resource(pc,url,"StoreGetACL");
    try {
      return toArrayStruct(res.getAccessControlPolicy().getAccessControlList());
    } catch (IOException e) {
      throw Caster.toPageException(e);
    }
    }
View Full Code Here

      throw Caster.toPageException(e);
    }
  }

  public static String _call(PageContext pc , String url, Object objACL) throws PageException, IOException {
    S3Resource res=toS3Resource(pc,url,"StoreAddACL");
    AccessControlPolicy acp = res.getAccessControlPolicy();
   
    List<AccessControl> acl = acp.getAccessControlList();
    List<AccessControl> newACL = AccessControl.toAccessControlList(objACL);
   
    Iterator<AccessControl> it = newACL.iterator();
    while(it.hasNext()){
      acl.add(it.next());
    }
    AccessControlPolicy.removeDuplicates(acl);
    res.setAccessControlPolicy(acp);
   
    return null;
  }
View Full Code Here

      throw Caster.toPageException(e);
    }
  }

  public static String _call(PageContext pc , String url, Object objACL) throws PageException, IOException {
    S3Resource res=toS3Resource(pc,url,"StoreSetACL");
    invoke(res, objACL);
    return null;
  }
View Full Code Here

  private static void setACL(Resource res,Object acl) 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)) {
            s3r.setACL(S3.toIntACL(Caster.toString(acl)));
          }
          // new way
          else {
            StoreSetACL.invoke(s3r, acl);
          }
View Full Code Here

TOP

Related Classes of railo.commons.io.res.type.s3.S3Resource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.