11-29-2011 06:38 PM
NodeRef companyHome = repository.getCompanyHome();
List<String> nodes = new ArrayList<String>();
nodes.add("myfolder");
NodeRef where = registry.getFileFolderService().resolveNamePath(companyHome, nodes).getNodeRef();
registry.getFileFolderService().create(where, "myfile",QNAME);
but I don't know what to put for QName parameter. It can't be null.11-29-2011 08:46 PM
import …
import org.alfresco.model.ContentModel;
import org.alfresco.repo.model.Repository;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.NodeRef;
…
private ServiceRegistry registry;
…
NodeRef companyHome = repository.getCompanyHome();
List<String> nodes = new ArrayList<String>();
nodes.add("myfolder");
NodeRef where = registry.getFileFolderService().resolveNamePath(companyHome, nodes).getNodeRef();
registry.getFileFolderService().create(where, "myfile", ContentModel.TYPE_CONTENT);
but now I'm trying to write an byte stream into that file. In fact, what I'm trying to do, is store serilized java object inside Alfresco repository.
11-29-2011 09:10 PM
ContentWriter writer = registry.getFileFolderService().getWriter(createdFile);
writer.putContent("lorem ipsum dolorem");
putContent method also receives an InputStream so it shouldn't be a problem to work with java serialization.11-30-2011 04:01 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.