mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
create the directory if it doesn't exist yet (checking in so britt can repro a bug in createDirectory)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3740 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -40,8 +40,7 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.service.cmr.avm.AVMExistsException;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.*;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
@@ -77,7 +76,18 @@ public class OutputUtil
|
||||
final String parentName = (String)
|
||||
nodeService.getProperty(caf.getParentRef(), ContentModel.PROP_NAME);
|
||||
LOGGER.debug("computed avm path " + PARENT_AVM_PATH + "/" + parentName);
|
||||
return PARENT_AVM_PATH + "/" + parentName;
|
||||
final String result = PARENT_AVM_PATH + "/" + parentName;
|
||||
AVMService avmService = AVMContext.fgInstance.getAVMService();
|
||||
try
|
||||
{
|
||||
avmService.lookup(-1, result);
|
||||
return result;
|
||||
}
|
||||
catch (AVMNotFoundException notFound)
|
||||
{
|
||||
avmService.createDirectory(PARENT_AVM_PATH, parentName);
|
||||
return PARENT_AVM_PATH;
|
||||
}
|
||||
}
|
||||
|
||||
public static void generate(NodeRef createdNode,
|
||||
|
Reference in New Issue
Block a user