Java Folder Read getFiles(final String path, Vector files)

Here you can find the source of getFiles(final String path, Vector files)

Description

get all files under the directory path

License

Apache License

Parameter

Parameter Description
path a parameter
files a parameter

Declaration

public static void getFiles(final String path, Vector<String> files) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.File;
import java.util.Vector;

public class Main {
    /**/*from   w ww . j av  a2  s  .com*/
     * get all files under the directory path
     * 
     * @param path
     * @param files
     */
    public static void getFiles(final String path, Vector<String> files) {
        getFiles(new File(path), files);
    }

    private static void getFiles(final File dir, Vector<String> files) {
        File[] filelist = dir.listFiles();
        for (File file : filelist) {
            if (file.isDirectory()) {
                getFiles(file, files);
            } else {
                files.add(file.getAbsolutePath());
            }
        }
    }
}

Related

  1. getFiles(File indir)
  2. getFiles(File... repertoires)
  3. getFiles(final File dir)
  4. getFiles(final File root, final String[] endings)
  5. getFiles(final String classPath)
  6. getFiles(List filepaths)
  7. getFiles(List filePaths)
  8. getFiles(List l, String directory)
  9. getFiles(String _path)