Package com.zaranux.client.java.util

Examples of com.zaranux.client.java.util.Properties


 
  private void listProperties(String absolutePath, final AsyncCallback<Boolean> callback)
  {
    FileInputStream fis = new FileInputStream(absolutePath);
   
    final Properties properties = new Properties();
    properties.load(fis, new AsyncCallback<Boolean>()
        {
        public void onSuccess(Boolean b)
        {
          properties.list(System.out, callback);
        }
        public void onFailure(Throwable t)
        {
          callback.onFailure(t);
        }
View Full Code Here


              if(b) // resource has an acl
              {
              // load it
              FileInputStream fis = new FileInputStream(aclFile);
             
              final Properties properties = new Properties();
              properties.load(fis, new AsyncCallback<Boolean>()
                  {
                  public void onSuccess(Boolean b)
                  {
                    if(properties.get("@public") == null)
                      properties.put("@public", "");
                    if(properties.get("@users") == null)
                      properties.put("@users", "");
                    callback.onSuccess(new ACL(file,properties,aclFile));
                  }
                  public void onFailure(Throwable t)
                  {
                    callback.onFailure(t);
                  }
                  });
              }else
              {
                final File metaDir = new File(aclDirPath);
                // acl does not exist. check if meta dir exists
               
                metaDir.exists(new AsyncCallback<Boolean>()
                    {
                     
                      public void onSuccess(Boolean b)
                      {
                        if(b)// meta dir exists
                        {
                          // return and empty property
                          Properties properties = new Properties();
                          properties.put("@public", "");
                          properties.put("@users", "");
                         
                          callback.onSuccess(new ACL(file,properties,aclFile));
                        }else
                        {
                          metaDir.mkdirs(new AsyncCallback<Boolean>()
                              {
                                public void onSuccess(Boolean b)
                                {
                                  Properties properties = new Properties();
                                  properties.put("@public", "");
                                  properties.put("@users", "");
                                 
                                  // return the default property
                                  callback.onSuccess(new ACL(file,properties,aclFile));
                                }
                                public void onFailure(Throwable t)
View Full Code Here

    if(groups != null ) {callback.onSuccess(groups); return;}
   
    groups = new Vector<Group>();
    FileInputStream fis = new FileInputStream(groupFile);
   
    final Properties groupProperties = new Properties();
    groupProperties.load(fis, new AsyncCallback<Boolean>()
        {
        public void onSuccess(Boolean b)
        {
          for(Object o : groupProperties.keySet())
          {
            Group g = new Group((String) o);
            String groupRecord = (String) groupProperties.get(o);
            // Display Name : memeber1,memeber2,...
            String[] fields = groupRecord.split(":",2);
            if(fields.length != 2) continue; // incorrect format
            g.setDisplayName(fields[0]);
            String[] members = fields[1].split(",");
View Full Code Here

TOP

Related Classes of com.zaranux.client.java.util.Properties

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.