+ Entity mediaType = null;
+
+ // find out if we an exact content-type match if so take it.
+ // otherwise just use the first one.
+ // @todo this should probably be moved to DatabaseMediaType -mh
+ for(int j=0;i<mediaTypesList.size();j++) {
+ if(contentType.equals(
+ mediaTypesList.elementAt(j).getValue("mime_type")))
+ mediaType = mediaTypesList.elementAt(j);
+ }
+
+ if( mediaType == null )
+ mediaType = mediaTypesList.elementAt(0);
+