for (File file : mp3Files) {
// only show live files
if (!file.isLive()) {
continue;
}
MP3File mp3 = new MP3File(file);
sw.write("<track>\n");
sw.write("<location>http://" + host.getHostname() + APILocator.getIdentifierAPI().find(folder).getPath() + file.getFileName()
+ "</location>\n");
if (UtilMethods.isSet(mp3.getArtist())) {
sw.write("<creator>" + XMLUtils.xmlEscape(mp3.getArtist()) + "</creator>\n");
}
if (UtilMethods.isSet(mp3.getAlbum())) {
sw.write("<album>" + XMLUtils.xmlEscape(mp3.getAlbum()) + "</album>\n");
}
if (UtilMethods.isSet(mp3.getTitle())) {
sw.write("<title>" + XMLUtils.xmlEscape(mp3.getTitle()) + "</title>\n");
}
if (UtilMethods.isSet(mp3.getGenre())) {
sw.write("<genre>" + XMLUtils.xmlEscape(mp3.getGenre()) + "</genre>\n");
}
if (mp3.getDuration() > 0) {
sw.write("<duration>" + mp3.getDuration() + "</duration>\n");
}
sw.write("<image>http://" + host.getHostname() + "/global/images/mp3logo.jpg</image>\n");
sw.write("</track>\n");