Examples of storeResource()


Examples of org.exist.xmldb.LocalCollection.storeResource()

        LocalCollection coll = (LocalCollection)root;
        coll.setReader(dataSource);
                                String existHome = System.getProperty("exist.home");
                                File existDir = existHome==null ? new File(".") : new File(existHome);
        doc.setContent(new File(existDir,FILE_STORED));
        coll.storeResource(doc);
        long t1 = System.currentTimeMillis();
        System.out.println("Time for storing:  " + ( t1-t0) + " ms." );
      }
    } catch (XMLDBException e) {
      fail(e.getMessage());
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

         // Create the XMLResource and store the document
         XMLResource resource =
               (XMLResource) col.createResource((String) table.get(XMLTools.NAME_OF),
                  "XMLResource");
         resource.setContent(ser.toString());
         col.storeResource(resource);
                          
         System.out.println("Added document " + table.get(XMLTools.COLLECTION) + "/" +
            resource.getId());
         resource = null;
      }    
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

         throws Exception {
      Collection col = DatabaseManager.getCollection(driver + "/" + path);

      XMLResource document = (XMLResource) col.createResource(name, "XMLResource");
      document.setContent(doc);
      col.storeResource(document);
   }

   public int countDocument(String path)
         throws Exception {
      Collection col = DatabaseManager.getCollection(driver + "/" + path);
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

                           homeaddress,workaddress);
     
         // Get the XMLResource and replace the content
         XMLResource resource = (XMLResource) col.getResource(dockey);
         resource.setContent(ourdoc);
         col.storeResource(resource);
        
      } catch ( Exception e) {
         e.printStackTrace();

    // there's not much else we can do if the response is committed
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

     * then retrieve it and verify that the data comes back right.
     */

        Resource newResource = collection.createResource(null, "BinaryResource");
        newResource.setContent(new byte[] { 0x00, 0x10, 0x01, 0x11 });
    collection.storeResource(newResource);
    String id = newResource.getId();

    Resource foundResource = collection.getResource(id);

    assertNotNull("We know you're in there...", foundResource);
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

        // then list resources.
        //

        Resource newResource = collection.createResource(null, "BinaryResource");
        newResource.setContent(new byte[] { 0x00, 0x10, 0x01, 0x11 });
        collection.storeResource(newResource);
        String id = newResource.getId();

        String[] resources = collection.listResources();
        assertNotNull("Can not be null", resources);
        assertEquals("Should have one resource", 1, resources.length);
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

     * then remove it and verify that it was indeed removed.
     */

        Resource newResource = collection.createResource(null, "BinaryResource");
        newResource.setContent(new byte[] { 0x00, 0x10, 0x01, 0x11 });
    collection.storeResource(newResource);
    String id = newResource.getId();

    Resource foundResource = collection.getResource(id);
    assertNotNull("It should be in there", foundResource);

View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }

        XMLResource document = (XMLResource) col.createResource(name, "XMLResource");
        document.setContent(doc);
        col.storeResource(document);
    }

    public int countDocument(String path) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        XMLResource document = (XMLResource) col.getResource(name);
        document.setContent(doc);
        col.storeResource(document);
    }

    public void getDocumentAsSax(String path, String name, ContentHandler handler) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
View Full Code Here

Examples of org.xmldb.api.base.Collection.storeResource()

            // Create the XMLResource and store the document
            XMLResource resource =
                    (XMLResource) col.createResource((String) table.get(XMLTools.NAME_OF),
                                                     "XMLResource");
            resource.setContent(ser.toString());
            col.storeResource(resource);

            System.out.println("Added document " + table.get(XMLTools.COLLECTION) + "/" +
                               resource.getId());
            resource = null;
        } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.