01-31-2012 11:44 AM
private void recursiveExport (Node root, String exportDir) throws RepositoryException, IOException {
if(root==null) {
return;
}
String currentDir = String.format("%s%s%s", exportDir, File.separator, root.getName().substring(root.getName().lastIndexOf(":")+1));
//folder
if(root.getPrimaryNodeType().getName().equals("cm:folder")){
new File(currentDir).mkdirs();
for(NodeIterator iterator = root.getNodes(); iterator.hasNext(); ){
Node child = iterator.nextNode();
recursiveExport(child, currentDir+File.separator);
child = null;
}
}
//file
else{
FileOutputStream fos = new FileOutputStream(currentDir);
Property prop = root.getProperty("cm:content");
if(prop==null){
return;
}
IOUtils.copy(prop.getStream(), fos);
fos.close();
prop.getStream().close();
prop = null;
root = null;
fos = null;
}
logger.info(String.format("%s exported.", currentDir));
}
ls -1 /proc/`pidof java`/fd | wc -l
The number of open files grows to high numbers (80000 in half an hour, my ulimit -n is 819200). I want this to exactly work like I have written the above code, opening the file, exporting it, and closing the streams, simple. I have checked which files are open, and they are *.bin files inside contentstore, so I suspect there is some configuration issues about it. 02-08-2012 05:43 AM
02-13-2012 09:43 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.