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:
Ray Gauss
2013-02-19 21:55:02 +00:00
parent df3c1b89e2
commit 29c86c027d
3 changed files with 6 additions and 6 deletions

View File

@@ -30,9 +30,6 @@ import java.util.Map;
*/ */
public abstract class AbstractTransformationSourceOptions implements TransformationSourceOptions, Cloneable 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 */ /** The list of applicable mimetypes */
private List<String> applicabledMimetypes; private List<String> applicabledMimetypes;

View File

@@ -22,6 +22,8 @@ package org.alfresco.service.cmr.repository;
import java.io.Serializable; import java.io.Serializable;
import java.util.Map; import java.util.Map;
import org.alfresco.repo.content.MimetypeMap;
/** /**
* DTO used to store options for ImageMagick cropping. * DTO used to store options for ImageMagick cropping.
* *
@@ -40,7 +42,7 @@ public class CropSourceOptions extends AbstractTransformationSourceOptions
public boolean isApplicableForMimetype(String sourceMimetype) public boolean isApplicableForMimetype(String sourceMimetype)
{ {
return ((sourceMimetype != null && return ((sourceMimetype != null &&
sourceMimetype.startsWith(MIMETYPE_IMAGE_PREFIX)) || sourceMimetype.startsWith(MimetypeMap.PREFIX_IMAGE)) ||
super.isApplicableForMimetype(sourceMimetype)); super.isApplicableForMimetype(sourceMimetype));
} }

View File

@@ -22,6 +22,7 @@ import java.io.Serializable;
import java.util.Map; import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.service.cmr.repository.AbstractTransformationSourceOptions; import org.alfresco.service.cmr.repository.AbstractTransformationSourceOptions;
/** /**
@@ -52,8 +53,8 @@ public class TemporalSourceOptions extends AbstractTransformationSourceOptions
public boolean isApplicableForMimetype(String sourceMimetype) public boolean isApplicableForMimetype(String sourceMimetype)
{ {
return ((sourceMimetype != null && return ((sourceMimetype != null &&
sourceMimetype.startsWith(MIMETYPE_VIDEO_PREFIX) || sourceMimetype.startsWith(MimetypeMap.PREFIX_VIDEO) ||
sourceMimetype.startsWith(MIMETYPE_AUDIO_PREFIX)) || sourceMimetype.startsWith(MimetypeMap.PREFIX_AUDIO)) ||
super.isApplicableForMimetype(sourceMimetype)); super.isApplicableForMimetype(sourceMimetype));
} }