Hello I am trying to retrieve the names of all the files of the type .mp3
from a source folder(below)
Below is the code I am using to differentiate the file type and add to the list. However I do not know which parameter I should enter into the directory
it should be music
folder however I do not know how to represent this.
File dir = new File("");
String[] files = dir.list(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".mp3");
};
});
for(int a = 0; a < files.length; a++)
{
musicList.add(files[a]);
}