mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
AVM Nodes are (theoretically) mostly aspect ready. AVMNodeService is
now derived from AbstractNodeServiceImpl to make policy awareness easier. Moved addDefaultPropertyValues from DbNodeServiceImpl to AbstractNodeServiceImpl so AVMNodeService can use it. A fix for an NPE that showed up in stress test. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3603 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -268,7 +268,6 @@ class AVMStoreImpl implements AVMStore, Serializable
|
||||
"UTF-8"));
|
||||
ContentWriter writer = getWriter(AVMNodeConverter.ExtendAVMPath(path, name));
|
||||
writer.putContent(data);
|
||||
file.setContentData(writer.getContentData());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,6 +301,12 @@ class AVMStoreImpl implements AVMStore, Serializable
|
||||
public InputStream getInputStream(int version, String path)
|
||||
{
|
||||
ContentReader reader = getReader(version, path);
|
||||
if (reader == null)
|
||||
{
|
||||
// TODO This is wrong, wrong, wrong. Do something about it
|
||||
// sooner rather than later.
|
||||
throw new AVMNotFoundException(path + " has no content.");
|
||||
}
|
||||
return reader.getContentInputStream();
|
||||
/*
|
||||
Lookup lPath = lookup(version, path, false);
|
||||
@@ -323,7 +328,7 @@ class AVMStoreImpl implements AVMStore, Serializable
|
||||
* @param path The path to the file.
|
||||
* @return A ContentReader.
|
||||
*/
|
||||
public ContentReader getReader(int version, String path)
|
||||
private ContentReader getReader(int version, String path)
|
||||
{
|
||||
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(version, fName + ":" + path);
|
||||
return AVMContext.fgInstance.getContentService().getReader(nodeRef, ContentModel.PROP_CONTENT);
|
||||
@@ -334,11 +339,12 @@ class AVMStoreImpl implements AVMStore, Serializable
|
||||
* @param path The path to the file.
|
||||
* @return A ContentWriter.
|
||||
*/
|
||||
public ContentWriter getWriter(String path)
|
||||
private ContentWriter getWriter(String path)
|
||||
{
|
||||
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, fName + ":" + path);
|
||||
ContentWriter writer =
|
||||
AVMContext.fgInstance.getContentService().getWriter(nodeRef, ContentModel.PROP_CONTENT, true);
|
||||
// TODO This can't perform very well.
|
||||
setContentData(path, writer.getContentData());
|
||||
return writer;
|
||||
}
|
||||
|
Reference in New Issue
Block a user