AnsweredAssumed Answered

adding binary content

Question asked by rcortesr on Nov 20, 2006
Latest reply on Nov 21, 2006 by rcortesr
I need to add binary content to my customized type.
I do it like in the example of wikiExample but the execution does not finish!!
This is my code:
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:org/alfresco/sample/jcr/facturaModel-context.xml");
           // Retrieve Repository
           Repository repository = (Repository)context.getBean("JCR.Repository");

           // Login to workspace
           // Note: Default workspace is the one used by Alfresco Web Client which contains all the Spaces
           //       and their documents
           Session session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
           // Retrieve a node
            Node myNode = (Node) session.getItem("app:company_home");
            System.out.println("Company home node: path=" + myNode.getPath() + ", type=" + myNode.getPrimaryNodeType().getName());

            Node facturas = myNode.addNode("fac:facturas", "cm:folder");
         facturas.setProperty("cm:name", "Facturas");
            facturas.setProperty("cm:description", "");
            line = buffer.readLine(); //leo la primera linea
            if(line == null) break;
            x.parsear(line); //parseo la siguiente linea
            Node fac1 = facturas.addNode("fac:entry" + cnt, "fac:factura");
               for(int i=0;i<4;i++)
                  if(i == 3) //añado el contenido, la imagen escaneada
                     //fac1.setProperty("cm:content", resource.getInputStream());
                     fac1.setProperty(campos[i], x.lista[i]); //Add a property
     ; //Persist the changes;
            System.out.println("¡¡¡Transferencia Completada!!!");

I have another question, why when I execute wikiExample appears the following error?
[size=75]Exception in thread "main" class path resource [org/alfresco/jcr/example/wikiImage.gif] cannot be opened because it does not exist
   at org.alfresco.sample.jcr.WIKIExample.main(