Examples of AclProperty


Examples of org.apache.webdav.lib.properties.AclProperty

    public AclProperty aclfindMethod(String path)
        throws HttpException, IOException {

        setClient();
       
        AclProperty acl = null;

        Vector properties = new Vector();
        properties.addElement("acl");
       
        // Default depth=0, type=by_name
View Full Code Here

Examples of org.apache.webdav.lib.properties.AclProperty

    public AclProperty aclfindMethod(String path)
        throws HttpException, IOException {
       
        setClient();
       
        AclProperty acl = null;
       
        Vector properties = new Vector();
        properties.addElement(AclProperty.TAG_NAME);
       
        // Default depth=0, type=by_name
View Full Code Here

Examples of org.apache.webdav.lib.properties.AclProperty

  }

  private boolean addPermission(WebdavResource webdavResource, String namespace, String permission, String path, String principal, boolean negative) throws HttpException, IOException
  {

    AclProperty acl = webdavResource.aclfindMethod(path);
    if (acl==null)
    {
      System.out.println("Error: PropFind didn't return an AclProperty!");
      return false;
    }
    Ace[] aces=acl.getAces();

    if (debugLevel>5) {
            System.out.println();
      System.out.println("ACL from server");
        showAces(path, aces);
    }
   
    Ace ace=null;
    for (int i=0; i<aces.length && (ace==null); i++)
    {
      if ((aces[i].isNegative()==negative) && !aces[i].isProtected()
          && !aces[i].isInherited() && aces[i].getPrincipal().equals(principal))
      {
        if (debugLevel>5)
          System.out.println("found ace");
        ace=aces[i];
      }
    }
    if (ace==null)
    {
      Ace[] oldAces=aces;
      aces=new Ace[oldAces.length+1];
      System.arraycopy(oldAces,0,aces,0,oldAces.length);
      ace=new Ace(principal, negative, false, false,null);
      aces[oldAces.length]=ace;
    }
   
    Privilege privilege=new Privilege(namespace, permission, null);
    ace.addPrivilege(privilege);
   
    if (debugLevel>5) {
      System.out.println();
      System.out.println("ACL with updated privileges");
        showAces(path, aces);
    }

    boolean success = webdavResource.aclMethod(path,aces);
 
    if (!success)
            System.err.println(webdavResource.getStatusMessage())

        if (debugLevel>5) {
          acl = webdavResource.aclfindMethod(path);
          if (acl==null)
            System.out.println("Error: PropFind didn't return an AclProperty!");
      else
     
            aces=acl.getAces();
              System.out.println();
              System.out.println("ACL from server after update");
              showAces(path, aces);
      }
        }
View Full Code Here

Examples of org.apache.webdav.lib.properties.AclProperty

    return success;
  }

  private boolean removePermission(WebdavResource webdavResource, String namespace, String permission, String path, String principal) throws HttpException, IOException
  {
    AclProperty acl = webdavResource.aclfindMethod(path);
    if (acl==null)
    {
      System.out.println("Error: PropFind didn't return an AclProperty!");
      return false;
    }
    Ace[] aces=acl.getAces();

    if (debugLevel>5) {
          System.out.println();
      System.out.println("ACL from server");
        showAces(path, aces);
    }
   
    boolean found=false;
    Privilege privilege=new Privilege(namespace, permission, null);
    for (int i=0; i<aces.length; i++)
    {
      if (!aces[i].isProtected() && !aces[i].isInherited() && aces[i].getPrincipal().equals(principal))
      {
        if (debugLevel>5)
          System.out.println("found ace");
        boolean removed = aces[i].removePrivilege(privilege);
        found = found || removed;
        if ((debugLevel>5) || removed)
          System.out.println("privilege removed");
      }
    }
   
    if (!found)
    {
      System.out.println("Privilege not found");
      return false;
    }
   
    if (debugLevel>5) {
      System.out.println();
      System.out.println("ACL with updated privileges");
        showAces(path, aces);
    }

    boolean success = webdavResource.aclMethod(path,aces);
 
    if (!success)
          System.err.println(webdavResource.getStatusMessage())

      if (debugLevel>5) {
        acl = webdavResource.aclfindMethod(path);
        if (acl==null)
          System.out.println("Error: PropFind didn't return an AclProperty!");
        else
       
            aces=acl.getAces();
            System.out.println();
            System.out.println("ACL from server after update");
            showAces(path, aces);
        }
      }
View Full Code Here

Examples of org.apache.webdav.lib.properties.AclProperty

    public AclProperty aclfindMethod(String path)
        throws HttpException, IOException {

        setClient();
       
        AclProperty acl = null;

        Vector properties = new Vector();
        properties.addElement(AclProperty.TAG_NAME);
       
        // Default depth=0, type=by_name
View Full Code Here

Examples of org.apache.webdav.lib.properties.AclProperty

    public AclProperty aclfindMethod(String path)
        throws HttpException, IOException {

        setClient();

        AclProperty acl = null;

        Vector properties = new Vector();
        properties.addElement(AclProperty.TAG_NAME);

        // Default depth=0, type=by_name
View Full Code Here

Examples of org.apache.webdav.lib.properties.AclProperty

    public AclProperty aclfindMethod(String path)
        throws HttpException, IOException {

        setClient();

        AclProperty acl = null;

        Vector properties = new Vector();
        properties.addElement(AclProperty.TAG_NAME);

        // Default depth=0, type=by_name
View Full Code Here

Examples of org.apache.webdav.lib.properties.AclProperty

    public AclProperty aclfindMethod(String path)
        throws HttpException, IOException {
       
        setClient();
       
        AclProperty acl = null;
       
        Vector properties = new Vector();
        properties.addElement(AclProperty.TAG_NAME);
       
        // Default depth=0, type=by_name
View Full Code Here

Examples of org.apache.webdav.lib.properties.AclProperty

    }

    private boolean addPermission(WebdavResource webdavResource, String namespace, String permission, String path, String principal, boolean negative) throws HttpException, IOException
    {

        AclProperty acl = webdavResource.aclfindMethod(path);
        if (acl==null)
        {
            System.out.println("Error: PropFind didn't return an AclProperty!");
            return false;
        }
        Ace[] aces=acl.getAces();
       
        if (aces==null)
            aces=new Ace[0];
               
        if (debugLevel>5) {
            System.out.println();
            System.out.println("ACL from server");
            showAces(path, aces);
        }
       
        Ace ace=null;
        for (int i=0; i<aces.length && (ace==null); i++)
        {
            if ((aces[i].isNegative()==negative) && !aces[i].isProtected()
                && !aces[i].isInherited() && aces[i].getPrincipal().equals(principal))
            {
                if (debugLevel>5)
                    System.out.println("found ace");
                ace=aces[i];
            }
        }
        if (ace==null)
        {
            Ace[] oldAces=aces;
            aces=new Ace[oldAces.length+1];
            System.arraycopy(oldAces,0,aces,0,oldAces.length);
            ace=new Ace(principal, negative, false, false,null);
            aces[oldAces.length]=ace;
        }
       
        Privilege privilege=new Privilege(namespace, permission, null);
        ace.addPrivilege(privilege);
       
        if (debugLevel>5) {
            System.out.println();
            System.out.println("ACL with updated privileges");
            showAces(path, aces);
        }

        boolean success = webdavResource.aclMethod(path,aces);
   
        if (!success)
            System.err.println(webdavResource.getStatusMessage());   

        if (debugLevel>5) {
            acl = webdavResource.aclfindMethod(path);
            if (acl==null)
                System.out.println("Error: PropFind didn't return an AclProperty!");
            else
            {   
                aces=acl.getAces();
                System.out.println();
                System.out.println("ACL from server after update");
                showAces(path, aces);
            }
        }
View Full Code Here

Examples of org.apache.webdav.lib.properties.AclProperty

        return success;
    }

    private boolean removePermission(WebdavResource webdavResource, String namespace, String permission, String path, String principal) throws HttpException, IOException
    {
        AclProperty acl = webdavResource.aclfindMethod(path);
        if (acl==null)
        {
            System.out.println("Error: PropFind didn't return an AclProperty!");
            return false;
        }
        Ace[] aces=acl.getAces();

        if (aces==null)
        {
            System.out.println("Privilege not found");
            return false;
        }

        if (debugLevel>5) {
            System.out.println();
            System.out.println("ACL from server");
            showAces(path, aces);
        }
       
        boolean found=false;
        Privilege privilege=new Privilege(namespace, permission, null);
        for (int i=0; i<aces.length; i++)
        {
            if (!aces[i].isProtected() && !aces[i].isInherited() && aces[i].getPrincipal().equals(principal))
            {
                if (debugLevel>5)
                    System.out.println("found ace");
                boolean removed = aces[i].removePrivilege(privilege);
                found = found || removed;
                if (removed)
                    System.out.println("Privilege removed");
            }
        }
       
        if (!found)
        {
            System.out.println("Privilege not found");
            return false;
        }
       
        if (debugLevel>5) {
            System.out.println();
            System.out.println("ACL with updated privileges");
            showAces(path, aces);
        }

        boolean success = webdavResource.aclMethod(path,aces);
   
        if (!success)
            System.err.println(webdavResource.getStatusMessage());   

        if (debugLevel>5) {
            acl = webdavResource.aclfindMethod(path);
            if (acl==null)
                System.out.println("Error: PropFind didn't return an AclProperty!");
            else
            {   
                aces=acl.getAces();
                System.out.println();
                System.out.println("ACL from server after update");
                showAces(path, aces);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.