Package abstrasy

Examples of abstrasy.Node


  }

  public Node external_file_path(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 2);
    File f = new File(startAt.getSubNode(1, Node.TYPE_STRING).getString());
    return new Node(f.getParent());
  }
View Full Code Here


  public Node external_is_match(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 3);
    File f = new File(startAt.getSubNode(1, Node.TYPE_STRING).getString());
    Private_FilenameFilter filefilter = new Private_FilenameFilter();
    filefilter.setMaskList(startAt.getSubNode(2, Node.TYPE_CLIST));
        return new Node(filefilter.accept(f) ? Node.TRUE: Node.FALSE);
  }
View Full Code Here

        return new Node(filefilter.accept(f) ? Node.TRUE: Node.FALSE);
  }

  public Node external_separator(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 1);
    return new Node(File.separator);
  }
View Full Code Here

  }

  public Node external_list_roots(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 1);
    File[] roots = File.listRoots();
        Node res = Node.createCList();
    for (int i = 0; i < roots.length; i++) {
      res.addElement(new Node(roots[i].getAbsolutePath()));
    }
    return res;
  }
View Full Code Here

    File f = new File(startAt.getSubNode(1, Node.TYPE_STRING).getString());
    if (startAt.size() == 3) {
      filefilter = new Private_FilenameFilter();
      filefilter.setMaskList(startAt.getSubNode(2, Node.TYPE_CLIST));
    }
        Node res = Node.createCList();
    File[] fl;
    if (filefilter == null) {
      fl = f.listFiles();
    }
    else {
      fl = f.listFiles(filefilter);
    }
    for (int i = 0; i < fl.length; i++) {
      res.addElement(new Node(fl[i].getName()));
    }
    return res;
  }
View Full Code Here

    for (int i = 0; i < fl.length; i++) {
      if (fl[i].isDirectory() && fl[i].getCanonicalPath().equals(fl[i].getAbsolutePath())) {
                _walk_files(fl[i],fx);
            }
            else{
                Node expr = Node.createExpr();
                expr.addElement(fx);
                expr.addElement(new Node(fl[i].getAbsolutePath()));
                expr.exec(true);
            }
        }
    }
View Full Code Here

    }
   
  public Node external_walk_files(Node startAt) throws Exception {
    startAt.isGoodArgsCnt(3);
    File f = new File(startAt.getSubNode(1, Node.TYPE_STRING).getString());
        Node lambda = startAt.getSubNode(2, Node.TYPE_FUNCTION);
    _walk_files(f,lambda);
    return null;
  }
View Full Code Here

    return null;
  }

  public Node external_user_path(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 1);
    return new Node(absDir(new File(System.getProperty("user.dir", "."))));
  }
View Full Code Here

    return new Node(absDir(new File(System.getProperty("user.dir", "."))));
  }

  public Node external_home_path(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 1);
    return new Node(absDir(new File(System.getProperty("user.home", "."))));
  }
View Full Code Here

  }

  public Node external_delete(Node startAt) throws Exception {
    startAt.isGoodArgsLength(true, 2);
    File f = new File(startAt.getSubNode(1, Node.TYPE_STRING).getString());
    return new Node((f.delete()) ? Node.TRUE: Node.FALSE);
  }
View Full Code Here

TOP

Related Classes of abstrasy.Node

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.