View Single Post
  #20 (permalink)  
Old 12-15-2007, 04:44 AM
staykovmarin staykovmarin is offline
Senior Member
 
Join Date: Nov 2007
Location: Newport, WA
Posts: 141
staykovmarin is on a distinguished road
Might want to change the for loop a little:
Code:
for (int i = 0; i < folderList.size(); i++) { if (folderList.get(i).isDirectory()) { // if its a directory, we get all its subfolders/files and add them to the folderList folderList.addAll(getSubs(folderList.get(i))); } // then we print out the data: System.out.println(folderList.get(i) + "\tDate Modified:\t" + new Date(folderList.get(i).lastModified()).toString()); // remove the current folder from the list, since we dont need it anymore folderList.remove(i); }
Reply With Quote