mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
More fixes to loading template/script files
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6201 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -28,10 +28,12 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
@@ -587,7 +589,7 @@ public class RepoStore implements WebScriptStore, ApplicationContextAware, Appli
|
||||
public Reader execute() throws Exception
|
||||
{
|
||||
ContentReader reader = contentService.getReader(nodeRef, ContentModel.PROP_CONTENT);
|
||||
return new InputStreamReader(reader.getContentInputStream());
|
||||
return new InputStreamReader(reader.getContentInputStream(), reader.getEncoding());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -676,7 +678,15 @@ public class RepoStore implements WebScriptStore, ApplicationContextAware, Appli
|
||||
*/
|
||||
public Reader getReader()
|
||||
{
|
||||
return new InputStreamReader(getInputStream());
|
||||
ContentReader reader = contentService.getReader(nodeRef, ContentModel.PROP_CONTENT);
|
||||
try
|
||||
{
|
||||
return new InputStreamReader(getInputStream(), reader.getEncoding());
|
||||
}
|
||||
catch (UnsupportedEncodingException e)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unsupported Encoding", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user