Package com.zaranux.client.java.io

Examples of com.zaranux.client.java.io.File


    if(args.length == 0)
      dir = getCurrentDirectory(); // current directory
    else
      dir = getAbsolutePath(args[0]);

    File d = new File(dir);
    d.list(new AsyncCallback<String[]>()
        {
          public void onSuccess(final String[] l)
          {
            StringBuffer result = new StringBuffer();
            if(l!=null)
View Full Code Here


  protected void execute(final AsyncCallback<Boolean> callback) {
    String[] args = getArgs();

    final String fileName = getAbsolutePath( args[0] );
   
    File f = new File(fileName + "/file" );
    f.delete(new AsyncCallback<Boolean>() {

      public void onFailure(Throwable caught) {
       
        System.out.print("Failed to delete " + fileName,callback);
       
View Full Code Here

public class ACL {

  public static void getACL(final String path, final AsyncCallback<ACL> callback)
  {
    getACL(new File(path), callback);
  }
View Full Code Here

          String name = file.getName();
          final String aclDirPath = file.getParent() + "/.zaranux/.meta/";
          String aclPath =  aclDirPath + name + ".zconfig";
         
          final File aclFile = new File(aclPath);
         
          // see if the resource has already an acl;
          aclFile.exists(new AsyncCallback<Boolean>()
          {
            public void onSuccess(Boolean b)
            {
              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", "");
View Full Code Here

TOP

Related Classes of com.zaranux.client.java.io.File

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.