public File[] listFiles(String directoryPath) {
        File[] result = null;
        File directory = null;
        directory = new File(directoryPath);
        if (directory.isDirectory()) {
            result = directory.listFiles();
        }
        return result;
    }
public File [ ] listFiles ( String directoryPath ) { File [ ] result = null ; File directory = null ; directory = new File ( directoryPath ) ; if ( directory . isDirectory ( ) ) { result = directory . listFiles ( ) ; } return result ; }
Get the list of files within the given directory. This only returns the
files in the immediate directory and is not recursive.

@param directoryPath The path of the directory

@return The list of files in the directory

@see File#listFiles()