What is wrong in this bit of MyID3 code? (error code is just Exceptions)
- by user3697621
Okay, so, this was supposed to get the paths of all mp3 files in a folder, read their metadata and put in an arraylist.
public static List<String> OrgMetadata(List<String> rawgenrelist){
File folder = new File("C:\\SOM\\");
File[] listOfFiles = folder.listFiles();
//File path = listOfFiles;
for (int i = 0; i < listOfFiles.length; i++) {
String pt = listOfFiles[i].getAbsolutePath();
File src = new File(pt);
MusicMetadataSet src_set = new MyID3().read(src);
if (src_set != null && listOfFiles[i].isFile()) {
IMusicMetadata metadata = src_set.getSimplified();
rawgenrelist.add(metadata.getGenreName());
}
}
List<String> genrelist;
genrelist = new ArrayList(new HashSet(rawgenrelist));
return genrelist;
}