What is wrong in this bit of MyID3 code? (error code is just Exceptions)
Posted
by
user3697621
on Stack Overflow
See other posts from Stack Overflow
or by user3697621
Published on 2014-06-01T21:07:41Z
Indexed on
2014/06/01
21:26 UTC
Read the original article
Hit count: 144
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;
}
© Stack Overflow or respective owner