Breaking News
Loading...
Friday, 30 August 2013

List files in directory with specified type

15:36
The example List all 'jpg' files in given directoty:

 private File[] getJpgFiles(File f){
File[] files = f.listFiles(new FilenameFilter(){

@Override
public boolean accept(File dir, String filename) {
return filename.toLowerCase().endsWith(".jpg");
}});

return files;
}


0 comments:

Post a Comment

 
Toggle Footer