/** * Creates an attachment. * * @param flavor * the attachment type * @param uri * the attachment location * @param size * the attachment size * @param checksum * the attachment checksum * @param mimeType * the attachment mime type */ protected AttachmentImpl(MediaPackageElementFlavor flavor, URI uri, long size, Checksum checksum, MimeType mimeType) { super(Type.Attachment, flavor, uri, size, checksum, mimeType); if (uri != null) try { this.setMimeType(MimeTypes.fromURI(uri)); } catch (UnknownFileTypeException e) { } }
/** * Creates an attachment. * * @param identifier * the attachment identifier * @param flavor * the attachment type * @param uri * the attachments location * @param size * the attachments size * @param checksum * the attachments checksum * @param mimeType * the attachments mime type */ protected AttachmentImpl(String identifier, MediaPackageElementFlavor flavor, URI uri, long size, Checksum checksum, MimeType mimeType) { super(identifier, Type.Attachment, flavor, uri, size, checksum, mimeType); if (uri != null) try { this.setMimeType(MimeTypes.fromURI(uri)); } catch (UnknownFileTypeException e) { } }
logger.warn("Invalid mimetype provided for timeline previews image"); try { composedImage.setMimeType(MimeTypes.fromURI(composedImage.getURI())); } catch (UnknownFileTypeException ex) { logger.warn("No valid mimetype could be found for timeline previews image");
element.setMimeType(MimeTypes.fromURI(file.toURI())); } catch (UnknownFileTypeException e) { logger.info("unable to determine the mime type for {}", file.getName());
MimeType mimeType = MimeTypes.fromURI(track.getURI());