Package org.xmldb.api.base

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


                if (resource == null) {
                    String message = "Resource " + name + " does not exist";
                    getLogger().debug(message);
                    throw new SourceException(message);
                } else {
                    collection.removeResource(resource);
                    getLogger().debug("Removed resource: "+ name);
                }
            } catch (XMLDBException e) {
                String message = "Failed to delete resource " + name + ": " + e.errorCode;
                getLogger().debug(message, e);
View Full Code Here


                                Resource resource = collection.getResource(this.key);
                                if (resource == null) {
                                    message = "Resource " + this.key + " does not exist";
                                    getLogger().debug(message);
                                } else {
                                    collection.removeResource(resource);
                                    result = "success";
                                }
                            } catch (XMLDBException e) {
                                message = "Failed to delete resource " + key + ": " + e.errorCode;
                                getLogger().debug(message, e);
View Full Code Here

        String[] resources = collection.listResources();
        assertNotNull("Can not be null", resources);
        assertEquals("Should have one resource", 1, resources.length);
        assertEquals("Resource ID should match", id, resources[0]);

        collection.removeResource(newResource);
    }

  public void testBinaryRemove() throws Exception {
    Collection collection = client.getCollection(TEST_COLLECTION_PATH);
    if (collection == null) {
View Full Code Here

    String id = newResource.getId();

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

        collection.removeResource(foundResource);
        foundResource = collection.getResource(id);
        assertNull("It should not be in there anymore", foundResource);
  }

  public void testBinaryMeta() throws Exception {
View Full Code Here

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

        col.removeResource(document);
    }
}
View Full Code Here

                return false;
            }

            Resource colresource = col.getResource(table.getString(XMLTools.NAME_OF));

            col.removeResource(colresource);
            System.out.println("DELETED: " + table.getString(XMLTools.COLLECTION) + "/" + table.getString(XMLTools.NAME_OF));
        } finally {
            if (col != null) {
                col.close();
            }
View Full Code Here

        
         // Get the documentKey for this particular Person
         String dockey = person.getDocKey();
        
         // Delete the document
         col.removeResource(col.getResource(dockey) );
        
      } catch (Exception e) {
          e.printStackTrace();

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

                                Resource resource = collection.getResource(this.key);
                                if (resource == null) {
                                    message = "Resource " + this.key + " does not exist";
                                    getLogger().debug(message);
                                } else {
                                    collection.removeResource(resource);
                                    result = "success";
                                }
                            } catch (XMLDBException e) {
                                message = "Failed to delete resource " + key + ": " + e.errorCode;
                                getLogger().debug(message, e);
View Full Code Here

        try {

            collection = getCollection("xmldb:xindice:///db/addressbook");

            Resource document = collection.getResource(args[0]);
            collection.removeResource(document);
            System.out.println("Document " + args[0] + " removed");
        } catch (XMLDBException e) {
            System.err.println("XML:DB Exception occured " + e.errorCode + " " + e.getMessage());
        } finally {
            if (collection != null) {
View Full Code Here

        
         // Get the documentKey for this particular Person
         String dockey = person.getDocKey();
        
         // Delete the document
         col.removeResource(col.getResource(dockey) );
        
      } catch (Exception e) {
         e.printStackTrace();

    // there's not much else we can do if the response is committed
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.