Examples of FileVisitor


Examples of org.nutz.lang.util.FileVisitor

                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

Examples of org.nutz.lang.util.FileVisitor

        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

Examples of org.nutz.lang.util.FileVisitor

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

Examples of org.olat.core.util.FileVisitor

    System.out.println("END");
    if(true) return;
    **/
   
   
    FileVisitor fv2 = new FileVisitor() {
     
      public void visit(File file) {
        // TODO Auto-generated method stub
        String fname = file.getName();
        if (!file.isDirectory() && fname.equals("LocalStrings.properties")) { // /de/org/olat/admin/cache/LocalStrings.properties
View Full Code Here

Examples of org.olat.core.util.FileVisitor

   
    final String pkgbase = srcbase+"/"+pack.replace('.','/');

    final Set pset = new HashSet();
   
    FileVisitor fv2 = new FileVisitor() {

      public void visit(File file) {
        String fname = file.getName();
        //System.out.println("filename: "+file.getAbsolutePath());
        if (!file.isDirectory() && fname.endsWith(".java")) {
View Full Code Here

Examples of org.olat.core.util.FileVisitor

   
    final String pkgbase = srcbase+"/"+pack.replace('.','/');

    final Set pset = new HashSet();
   
    FileVisitor fv2 = new FileVisitor() {

      public void visit(File file) {
        String fname = file.getName();
        //System.out.println("filename: "+file.getAbsolutePath());
        if (!file.isDirectory() && fname.endsWith(".java")) {
View Full Code Here

Examples of org.olat.core.util.FileVisitor

  /**
   * @param args
   */
  public static void main(String[] args) {
    // work in progress
    FileVisitor fv = new FileVisitor() {

      public void visit(File file) {
        // TODO Auto-generated method stub
        String fname = file.getName();
        if (fname.endsWith(".java")) {
View Full Code Here

Examples of org.olat.core.util.FileVisitor

    // package org.olat.admin(.xxx) -> package org.abc.def.ghi(.xxx)
    // and import org.olat.admin(.xxx) -> import org.abc.def.ghi(.xxx)
    // in headers

    // clear the cvs stuff
    FileVisitor fcvs = new FileVisitor() {

      public void visit(File file) {
        if (file.getParentFile().isDirectory() && file.getParentFile().getName().equals("CVS")) {
          FileUtils.deleteDirsAndFiles(file, true, true);
        }
      }

    };
    FileUtils.visitRecursively(todirF, fcvs);

    System.out.println("adjusting file contents......");
   
    final String regexp3 = packageFrom.replaceAll("\\.", "\\\\.");
   
    FileVisitor fv = new MF(regexp3, packageTo);

    FileUtils.visitRecursively(new File(srcbase), fv);

  }
View Full Code Here

Examples of org.olat.core.util.FileVisitor

      for (int i = 0; i < courses.length; i++) {
        String course = courses[i];
        File courseRoot = new File(coursesRoot, course);
        File cFolder = new File(courseRoot, "coursefolder");
        log.audit("visiting "+cFolder.getAbsolutePath());
        FileVisitor fv = new FileVisitor() {

          public void visit(File file) {
            String rpage = null;
            String fname = file.getName();
            if ((file.isFile())&&(fname.endsWith(".htm") || fname.endsWith(".html"))) {
View Full Code Here

Examples of org.olat.core.util.FileVisitor

  public void addMenuToZip(String pathToCPOfflineMatDir, String pathToRepository) {
    final File cpOfflineMatDir = new File(pathToCPOfflineMatDir);
    File pathToRepositoryDir = new File(pathToRepository);

    FileUtils.visitRecursively(pathToRepositoryDir, new FileVisitor() {
      private CPOfflineReadableManager corm = CPOfflineReadableManager.getInstance();

      public void visit(File file) {
        if (file.getName().equals("imsmanifest.xml")) {
          File unzippedDir = file.getParentFile();
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.