import java.io.* ;
public class ListOfTodaysFiles {
public static void main(String str[]){
String todaysfilepattern = "MMDD\\..*";
final Pattern pattern = Pattern.compile(todaysfilepattern);
FilenameFilter filenameFilter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name)
{
Matcher m = pattern.matcher(name);
return m.matches();
}
};
File currentDir = new File( "Current_DIR" );
String[] todaysfiles = currentDir.list(filenameFilter);
}
}
public static void main(String str[]){
String todaysfilepattern = "MMDD\\..*";
final Pattern pattern = Pattern.compile(todaysfilepattern);
FilenameFilter filenameFilter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name)
{
Matcher m = pattern.matcher(name);
return m.matches();
}
};
File currentDir = new File( "Current_DIR" );
String[] todaysfiles = currentDir.list(filenameFilter);
}
}
1 comment:
That was great to read.
also, join Java course in Pune
Post a Comment