public String[] createFrom(AudioFile audioFile, Integer bitrate)
throws MissingValueException {
ArrayList result = new ArrayList();
StringBuffer buffer = new StringBuffer();
ArrayList missingTags = new ArrayList();
Tag tag = audioFile.getTag();
Iterator sectionIt = sections.iterator();
while (sectionIt.hasNext()) {
buffer.delete(0, buffer.length());
Section current = (Section) sectionIt.next();
if (current.fileDirectory) {
String absParentPath = audioFile.getParentFile()
.getAbsolutePath();
String[] splitted = saveSplit(absParentPath, File.separator);
for (int i = 0; i < splitted.length; i++) {
result.add(splitted[i]);
}
} else {
for (int i = 0; i < current.parts.length; i++) {
if (current.parts[i] instanceof String) {
buffer.append(current.parts[i].toString());
} else {
int index = ((Integer) current.parts[i]).intValue();
String value = null;
switch (index) {
case 0:
value = tag.getFirstArtist();
break;
case 1:
value = tag.getFirstAlbum();
break;
case 2:
value = tag.getFirstTitle();
break;
case 3:
value = tag.getFirstTrack();
break;
case 4:
value = tag.getFirstGenre();
break;
case 5:
value = tag.getFirstYear();
break;
case 6:
value = tag.getFirstComment();
break;
case 7:
if (bitrate != null) {
value = bitrate.toString();
} else {