public static String[] getFileList(String path, final String fileType) {
File dir = new File(path);
if (dir == null)
return new String[0];
return dir.list(new FilenameFilter() {
public boolean accept(File dir, String name) {
if (fileType.equals(""))
return true;
else
return name.endsWith("."+ fileType);
}
});
}