08-19-2008 03:01 PM
08-20-2008 09:16 AM
org.alfresco.web.bean.repository.Repository
public static String getMimeTypeForFileName(FacesContext context, String filename)
{
// base the mimetype from the file extension
MimetypeService mimetypeService = (MimetypeService)getServiceRegistry(context).getMimetypeService();
// fall back to binary mimetype if no match found
String mimetype = MimetypeMap.MIMETYPE_BINARY;
int extIndex = filename.lastIndexOf('.');
if (extIndex != -1)
{
String ext = filename.substring(extIndex + 1).toLowerCase();
String mt = mimetypeService.getMimetypesByExtension().get(ext);
if (mt != null)
{
mimetype = mt;
}
}
return mimetype;
}
org.alfresco.repo.content.MimetypeMap implements MimetypeService
08-26-2008 02:37 PM
request.getContentType()09-05-2008 08:37 AM
net.sf.jmimemagic.Magic.getMagicMatch(the_file).getMimeType()Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.