@Override
public String executeAction(HttpServletRequest request,
List<FileItem> sessionFiles) throws UploadActionException {
logger.trace("#executeAction(HttpServletRequest, List<FileItem>), "
+ "first up grabbing the current DJ");
JizzDj dj = jizzDjServices.getCurrentDj();
logger.trace("Grabbing the next braodcast");
JizzBroadcast broadcast = jizzBroadcastServices.getNextBroadcast(dj
.getStation());
for (FileItem fileItem : sessionFiles) {
if (!(fileItem instanceof JizzFileItem)) {
logger.error("Somehow got a non-JizzFileItem instance");
throw new UploadActionException("Only JizzFileItem's "
+ "supported");
}
JizzFileItem jizzFileItem = (JizzFileItem) fileItem;
logger.trace("Uploading song using blob {}", jizzFileItem.getBlob());
jizzSongServices.uploadSong(dj.getStation(), dj, broadcast,
jizzFileItem.getBlob());
}
// This is as per what we're told to do by GWT Upload
logger.trace("Removing session file items");