eu.etaxonomy.cdm.model.media
Class MediaUtils
java.lang.Object
eu.etaxonomy.cdm.model.media.MediaUtils
public class MediaUtils
- extends Object
|
Method Summary |
static MediaRepresentation |
findBestMatchingRepresentation(Media media,
Class<? extends MediaRepresentationPart> representationPartType,
Integer size,
Integer height,
Integer widthOrDuration,
String[] mimeTypes)
|
static Map<Media,MediaRepresentation> |
findPreferredMedia(List<Media> mediaList,
Class<? extends MediaRepresentationPart> representationPartType,
String[] mimeTypes,
String[] sizeTokens,
Integer widthOrDuration,
Integer height,
Integer size)
Filters the given List of Media by the supplied filter parameters representationPartType,
mimeTypes, sizeTokens, widthOrDuration, height, size. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MediaUtils
public MediaUtils()
findBestMatchingRepresentation
public static MediaRepresentation findBestMatchingRepresentation(Media media,
Class<? extends MediaRepresentationPart> representationPartType,
Integer size,
Integer height,
Integer widthOrDuration,
String[] mimeTypes)
- Parameters:
representationPartType - TODOsize - height - widthOrDuration - mimeTypeRegexes -
- Returns:
findPreferredMedia
public static Map<Media,MediaRepresentation> findPreferredMedia(List<Media> mediaList,
Class<? extends MediaRepresentationPart> representationPartType,
String[] mimeTypes,
String[] sizeTokens,
Integer widthOrDuration,
Integer height,
Integer size)
- Filters the given List of Media by the supplied filter parameters
representationPartType,
mimeTypes, sizeTokens, widthOrDuration, height, size.
Only best matching MediaRepresentation remains attached to the Media entities.
A Media entity may be completely omitted in the resulting list if filterAndOrderMediaRepresentations(Set, Class, String[], Integer, Integer, Integer)
is not returning any matching representation. This can be the case if a representationPartType is supplied.
In order to prevent the media entities returned by this method from being persisted accidentally the resulting list contains cloned versions of the originally
supplied media entities, which have the same UUIDs as the original ones.
- Parameters:
mediaList - representationPartType - any subclass of MediaRepresentationPartmimeTypes - sizeTokens - widthOrDuration - height - size -
- Returns:
Copyright © 2007-2013 EDIT. All Rights Reserved.