Java File List Load getFileListInFolder(String path)

Here you can find the source of getFileListInFolder(String path)

Description

get File List In Folder

License

Open Source License

Declaration

public static File[] getFileListInFolder(String path) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.*;

import java.util.ArrayList;

public class Main {
    public static File[] getFileListInFolder(String path) {
        ArrayList<File> results = new ArrayList<>();
        File[] files = new File(path).listFiles();
        for (File file : files) {
            if (file.isFile()) {
                results.add(file);/*ww  w  . j  a v a2s .co m*/
            }
        }
        return results.toArray(new File[0]);
    }

    public static double[][] add(double[][] a, double[][] b) {
        double[][] d = new double[a.length][a[0].length];
        if (isIdenticalMatrix(a, b)) {
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < a[0].length; j++) {
                    d[i][j] = a[i][j] + b[i][j];
                }
            }
        } else {

        }
        return d;
    }

    private static boolean isIdenticalMatrix(double[][] a, double[][] b) {
        if (a.length == b.length && a[0].length == b[0].length) {
            return true;
        } else {
            return false;
        }
    }
}

Related

  1. getFileList(String zipFilePath)
  2. getFileListByDFS(File file)
  3. getFileListByExtension(final String location, final String extension)
  4. getFileListByRegex(String dir, final String regex)
  5. getFileListDeep(File path)
  6. getFileListInFolderForImages(String imageFolder)
  7. getFileListing(File aStartingDir)
  8. getFileListing(File dir)
  9. getFileListing(File directory)