mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Updated source options to use prefixes now defined in MimetypeMap
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@46812 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -30,9 +30,6 @@ import java.util.Map;
|
||||
*/
|
||||
public abstract class AbstractTransformationSourceOptions implements TransformationSourceOptions, Cloneable
|
||||
{
|
||||
protected static final String MIMETYPE_VIDEO_PREFIX = "video/";
|
||||
protected static final String MIMETYPE_AUDIO_PREFIX = "audio/";
|
||||
protected static final String MIMETYPE_IMAGE_PREFIX = "image/";
|
||||
|
||||
/** The list of applicable mimetypes */
|
||||
private List<String> applicabledMimetypes;
|
||||
|
@@ -22,6 +22,8 @@ package org.alfresco.service.cmr.repository;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
|
||||
/**
|
||||
* DTO used to store options for ImageMagick cropping.
|
||||
*
|
||||
@@ -40,7 +42,7 @@ public class CropSourceOptions extends AbstractTransformationSourceOptions
|
||||
public boolean isApplicableForMimetype(String sourceMimetype)
|
||||
{
|
||||
return ((sourceMimetype != null &&
|
||||
sourceMimetype.startsWith(MIMETYPE_IMAGE_PREFIX)) ||
|
||||
sourceMimetype.startsWith(MimetypeMap.PREFIX_IMAGE)) ||
|
||||
super.isApplicableForMimetype(sourceMimetype));
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,7 @@ import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.service.cmr.repository.AbstractTransformationSourceOptions;
|
||||
|
||||
/**
|
||||
@@ -52,8 +53,8 @@ public class TemporalSourceOptions extends AbstractTransformationSourceOptions
|
||||
public boolean isApplicableForMimetype(String sourceMimetype)
|
||||
{
|
||||
return ((sourceMimetype != null &&
|
||||
sourceMimetype.startsWith(MIMETYPE_VIDEO_PREFIX) ||
|
||||
sourceMimetype.startsWith(MIMETYPE_AUDIO_PREFIX)) ||
|
||||
sourceMimetype.startsWith(MimetypeMap.PREFIX_VIDEO) ||
|
||||
sourceMimetype.startsWith(MimetypeMap.PREFIX_AUDIO)) ||
|
||||
super.isApplicableForMimetype(sourceMimetype));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user