I have a program that searches a file and the program says that my import (FileUtils) is not existing in the packages.. does this mean i need to download a seperate package for this?
here is the code
import org.apache.commons.io.FileUtils; import java.io.File; import java.util.Collection; import java.util.Iterator; public class SearchFile{ public static void main(String[] args) { File root = new File("D:\Program Files"); try { String[] extensions = {"txt"}; boolean recursive = true; Collection files = FileUtils.listFiles(root, extensions, recursive); for (Iterator iterator = files.iterator(); iterator.hasNext();) { File pfile = (File) iterator.next(); System.out.println("File Found: " + pfile.getAbsolutePath()); } } catch (Exception e) { e.printStackTrace(); } } }
EDIT: oopss. wrong title.. sorry..