jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomasg <thomasgascoi...@hotmail.com>
Subject Removing a node of type nt:file
Date Fri, 31 Mar 2006 10:25:40 GMT

Hi, I am adding a nt:file node and nt:resource, confirming that a search
finds a word, trying to remove the file node and then confriming that the
same search returns nothing. This proceeds as expected except that I get the
following warning when doing the second session.save():	

WARN org.apache.jackrabbit.core.value.BLOBFileValue - Error while deleting
BLOBFileValue: failed to delete

This is the add / remove part of the code:

Node folderNode = root.addNode("foldernode", "nt:folder");	        
File file = new File(TEST_DIR +
Node fileNode = folderNode.addNode(file.getName(), "nt:file");
Node resourceNode = fileNode.addNode("jcr:content", "nt:resource");
resourceNode.setProperty("jcr:mimeType", MIME_TYPE);
resourceNode.setProperty("jcr:data", new FileInputStream(file));
Calendar lastModified = Calendar.getInstance();
resourceNode.setProperty("jcr:lastModified", lastModified);  

folderNode = root.getNode("foldernode");
fileNode = folderNode.getNode(file.getName());
session.save(); //Warning here

Is this a reasonable way to be removing  a nt:file node and associated
nt:resource node? Any comments would be welcome.

Thanks, Thomas

View this message in context: http://www.nabble.com/Removing-a-node-of-type-nt%3Afile-t1373899.html#a3687050
Sent from the Jackrabbit - Dev forum at Nabble.com.

View raw message