public static ArrayList<String> getAllFiles(String directory){
ArrayList<String> listOfFiles = new ArrayList<String>();
File fileDirectory = new File(directory);
for (final File fileEntry : fileDirectory.listFiles()) {
if(fileEntry.isFile()){
listOfFiles.add(fileDirectory.getAbsolutePath()+ "/" + fileEntry.getName()); //Add absolute path.
}
}
return listOfFiles;
}
No comments:
Post a Comment