mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix for ALF-11275
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31796 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -3490,13 +3490,14 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider
|
||||
{
|
||||
ContentService contentService = services.getContentService();
|
||||
ContentWriter writer = contentService.getWriter(nodeRef, this.property, true);
|
||||
InputStream is = null;
|
||||
if (applyMimetype)
|
||||
{
|
||||
writer.setMimetype(content.getMimetype());
|
||||
}
|
||||
if (guessEncoding)
|
||||
{
|
||||
InputStream is = new BufferedInputStream(content.getInputStream());
|
||||
is = new BufferedInputStream(content.getInputStream());
|
||||
is.mark(1024);
|
||||
writer.setEncoding(guessEncoding(is, false));
|
||||
try
|
||||
@@ -3510,8 +3511,9 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider
|
||||
else
|
||||
{
|
||||
writer.setEncoding(content.getEncoding());
|
||||
is = content.getInputStream();
|
||||
}
|
||||
writer.putContent(content.getInputStream());
|
||||
writer.putContent(is);
|
||||
|
||||
// update cached variables after putContent()
|
||||
this.contentData = (ContentData) services.getNodeService().getProperty(nodeRef, this.property);
|
||||
|
Reference in New Issue
Block a user