Package org.nutz.lang.util

Examples of org.nutz.lang.util.FileVisitor


      return list;

    if (!f.isDirectory())
      f = f.getParentFile();
    final String base = f.getAbsolutePath();
    Disks.visitFile(f, new FileVisitor() {
      public void visit(File file) {
        list.add(new FileResource(base, file));
      }
    }, new FileFilter() {
      public boolean accept(File theFile) {
View Full Code Here


                if (null == f) {
                    throw Lang.makeThrow("Fail to found path '%s' in CLASSPATH or File System!", s);
                }
                // 如果是一个包,引用全部 Files
                if (f.isDirectory()) {
                    Disks.visitFile(f, new FileVisitor() {
                        public void visit(File f) {
                            me.joinAndClose(Streams.fileInr(f));
                        }
                    }, new FileFilter() {
                        public boolean accept(File f) {
View Full Code Here

        CleanCode.removeTabs("tools");
    }
   
    public static int removeTabs(String path) {
        final int[] re = new int[1];
        Disks.visitFile(new File(path), new FileVisitor() {
           
            public void visit(File file) {
                if (file.isDirectory())
                    return;
                if (!file.getName().endsWith(".java"))
View Full Code Here

public class UTF8_BOM {

    public static void main(String[] args) {
        final byte[] UTF_BOM = new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF};
        final byte[] bom = new byte[3];
        Disks.visitFile(new File("."), new FileVisitor() {
           
            public void visit(File file) {
                try {
                    FileInputStream fis = new FileInputStream(file);
                    fis.read(bom);
View Full Code Here

TOP

Related Classes of org.nutz.lang.util.FileVisitor

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.