As suggested in the previous discussion, Using the file system instead of the database for storing pdf files in jackrabbit
we can use FileDataStoreto store blob files in the file system instead of the database (in my case, files of ~ 100 kb were saved).
The next issue that I am facing concerns files that were previously saved in blobstore, and I want them to be available after going to FileDataStore.
After adding support FileDataStoreto the repository.xml file when using the method, JcrUtils getOrAddNodeI get ItemExistsException:
public static Node getOrAddNode(Node parent, String name)
throws RepositoryException {
if (parent.hasNode(name)) {
return parent.getNode(name);
} else {
return parent.addNode(name);
}
}
eg. parent.hasNode(name)returns false (the element does not seem to exist), but then we get into the code parent.addNode(name), which, therefore, throws an ItemExistsException.
Any help?
Do I need to move blobs to FileDataStore, or is there some kind of configuration that jackrabbit can look for in blocks in different places at the same time: in my case, the mysql database and file system.
Some comments:
I found at least a few ways that could help complete the migration task: