Fixed ALF-10813: MimetypeMap.guessMimetype consumes 30% of file upload time

- Only construct the detector once when the configuration is provided
 - Don't guess mimetypes when the mimetype has already been provided
 - All of the above need reviewing or refixing as long as the performance is not lost


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31222 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2011-10-14 03:51:33 +00:00
parent 42963bd022
commit 2fe2385d2b

View File

@@ -242,6 +242,8 @@ public class FileFolderPerformanceTester extends TestCase
NodeRef nodeRef = fileInfo.getNodeRef();
// write the content
ContentWriter writer = fileFolderService.getWriter(nodeRef);
writer.setEncoding("UTF-8");
writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
writer.putContent(dataFile);
}
// done