i write a program that will search for files with the given extension in my PC. now i want to add one more thing to it. i wish that my program will copy these files into a specific location on my PC. here is my code sample :-
Finder(String pattern)
{
matcher = FileSystems.getDefault().getPathMatcher("glob:" + pattern);
}
// Compares the pattern against
// the file or directory name.
void find(Path file) {
Path name = file.getFileName();
if (name != null && matcher.matches(name)) {
System.out.println(file);
String s = new String(name.toString());
//System.out.println(s);
File f = new File(s);
//System.out.println(f.getAbsolutePath());
FileInputStream fileInputStream = null;