ContentData will now force it to 'application/octet-stream'

- The Share UI sets the mimetype to empty string ('') if the mimetype is unknown


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16466 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-09-23 17:13:06 +00:00
parent 0a36194042
commit 7e0d38e62a

View File

@@ -29,6 +29,7 @@ import java.util.Locale;
import java.util.StringTokenizer;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
import org.alfresco.util.EqualsHelper;
@@ -195,6 +196,10 @@ public class ContentData implements Serializable
*/
public ContentData(String contentUrl, String mimetype, long size, String encoding, Locale locale)
{
if (mimetype == null || mimetype.length() == 0)
{
mimetype = MimetypeMap.MIMETYPE_BINARY;
}
checkContentUrl(contentUrl, mimetype, encoding);
this.contentUrl = contentUrl;
this.mimetype = mimetype;