Fix for ALF-2118:

- Added new method to MimetypeService to retrieve a valid mimetype given any extension, handling case and missing values
 - Updated JUnit tests for MimetypeService methods
 - Fixed callers of MimetypeService to use new method to protect against varying case of file extensions (ALF-2118 root cause)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19400 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2010-03-19 14:45:29 +00:00
parent 7647f1e449
commit c2ddf8dc14
3 changed files with 52 additions and 14 deletions

View File

@@ -31,7 +31,6 @@ import org.alfresco.service.PublicService;
* This service interface provides support for Mimetypes.
*
* @author Derek Hulley
*
*/
@PublicService
public interface MimetypeService
@@ -41,11 +40,19 @@ public interface MimetypeService
*
* @param mimetype a valid mimetype
* @return Returns the default extension for the mimetype
* @throws AlfrescoRuntimeException if the mimetype doesn't exist
*/
@NotAuditable
public String getExtension(String mimetype);
/**
* Get the mimetype for the specified extension
*
* @param extension a valid file extension
* @return Returns a valid mimetype if found, or null if does not exist
*/
@NotAuditable
public String getMimetype(String extension);
/**
* Get all human readable mimetype descriptions indexed by mimetype extension
*