*
*/
private void checkUploadLooksOk() throws BadRequestException {
final Request req = getRequest();
final Locale locale = getLocale();
final UploadFile file = req.getFile( "musicFile" );
if ( file == null )
throw new BadRequestException( locale.getString("www.error.noFileUploaded") );
// check mime type to see if it looks ok
final String contentType = file.getContentType();
log.debug( "File content type: " + contentType );
if ( !Files.isValidMimeType(contentType) )
throw new BadRequestException( locale.getString("www.error.unsupportedAudioFormat") );
// check required fields
final Database db = getDatabase();
final Validater v = new Validater( db );
final String artist = req.getArgument( "artist" );
final String album = req.getArgument( "album" );
final String track = req.getArgument( "title" );
if ( !v.checkRequiredFields( new String[] { artist, album, track }) )
throw new BadRequestException( locale.getString("www.error.missingField") );
}