{{theTime}}

Search This Blog

Total Pageviews

How to filter the file names in a directory using Java.

 
public String[] filterFileNames() throws IOException
   String pattern = "Today";
   final Pattern p = Pattern.compile(pattern);
   FilenameFilter filter = new FilenameFilter() {
   public boolean accept(File fdir, String fname)
   {
       Matcher m = p.matcher(fname);
       return m.matches();
   }};
   File dirFile = new File( "directory path" );
   String[] filteredFiles = dirFile.list(filter); 
   return filteredFiles ;
}



No comments:

Could not find method signingConfigs() for arguments

Could not find method signingConfigs() for arguments [build_5dw7nwfc8ibd8sagvx4p79x1u$_run_closure5@13e86039] on root project 'android&#...