Java tutorial
//package com.java2s; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { public static List<File> getAll(String path) { File file = new File(path); if (!file.isDirectory()) return new ArrayList<File>(); return Arrays.asList(file.listFiles()); } }