mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged HEAD (5.1) to 5.1.N (5.1.1)
116418 mrogers: ACE-4523 - Binary File mimetype is set to files edited via CIFS/FTP git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@117194 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -3035,9 +3035,28 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD
|
||||
nodeService.setProperty(target, ContentModel.PROP_MODIFIED, new Date());
|
||||
}
|
||||
|
||||
// Take an initial guess at the mimetype (if it has not been set by something already)
|
||||
/**
|
||||
* Take a guess at the mimetype
|
||||
*/
|
||||
String mimetype = mimetypeService.guessMimetype(tempFile.getFullName(), new FileContentReader(tempFile.getFile()));
|
||||
logger.debug("guesssed mimetype:" + mimetype);
|
||||
|
||||
/**
|
||||
* mime type guessing may have failed in which case we should assume the mimetype has not changed.
|
||||
*/
|
||||
if(mimetype.equalsIgnoreCase(MimetypeMap.MIMETYPE_BINARY))
|
||||
{
|
||||
// mimetype guessing may have failed
|
||||
if(existingContent != null)
|
||||
{
|
||||
// copy the mimetype from the existing content.
|
||||
mimetype = existingContent.getMimetype();
|
||||
if(logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("using mimetype of existing content :" + mimetype);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String encoding;
|
||||
// Take a guess at the locale
|
||||
|
Reference in New Issue
Block a user