Java Folder Read getFiles(File dir)

Here you can find the source of getFiles(File dir)

Description

get Files

License

Open Source License

Declaration

public static File[] getFiles(File dir) throws IOException 

Method Source Code

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

import java.io.File;

import java.io.IOException;

public class Main {

    public static File[] getFiles(File dir) throws IOException {
        if (dir.isFile())
            throw new IOException("BadInputException: not a directory.");
        if (!dir.exists()) {
            throw new IOException(" don't exist ");
        }//from  w w  w. ja va 2 s .c om
        File[] files = dir.listFiles();
        return files;
    }
}

Related

  1. getFiles(Collection folders)
  2. getFiles(File apkFile, Pattern regex)
  3. getFiles(File archive)
  4. getFiles(File dir)
  5. getFiles(File dir)
  6. getFiles(File dir, File... excludes)
  7. getFiles(File dir, final String pattern)
  8. getFiles(File dir, String... names)
  9. getFiles(File directory)