public static ArrayList<String> files=new ArrayList<String>();
public static ArrayList<String> ReturnAllFileFromAFolder(String FolderPath)
{
File folder = new File(FolderPath);
File[] listOfFiles = folder.listFiles();
for (int i = 0; i < listOfFiles.length; i++) {
if (listOfFiles[i].isFile()) {
// System.out.println("File " + listOfFiles[i].getName());
files.add(FolderPath+"/"+listOfFiles[i].getName());
} else if (listOfFiles[i].isDirectory()) {
// System.out.println("Directory " + listOfFiles[i].getName());
//files.add(FolderPath+"/"+listOfFiles[i].getName());
ReturnAllFileFromAFolder( FolderPath+"/"+listOfFiles[i].getName());
}
}
return files;
}
No comments:
Post a Comment
Thank you for Commenting Will reply soon ......