I'm not gonna give you code, but check out java.io.File and especiallylistFiles() and the other variations of the same method with FileFilters.If you don't even know what dirs are on the system you're looking at uselistRoots() .