import org.apache.poi.POIDocument;
import org.apache.poi.poifs.filesystem.EntryUtils;
+import org.apache.poi.poifs.filesystem.FilteringDirectoryNode;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.OPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
writeProperties(fs, excepts);
// Copy over everything else unchanged
- EntryUtils.copyNodes(directory, fs.getRoot(), excepts);
+ FilteringDirectoryNode src = new FilteringDirectoryNode(directory, excepts);
+ FilteringDirectoryNode dest = new FilteringDirectoryNode(fs.getRoot(), excepts);
+ EntryUtils.copyNodes(src, dest);
// Caller will save the resultant POIFSFileSystem to the stream/file
}
copyNodes( (DirectoryEntry)filteredSource, (DirectoryEntry)filteredTarget );
}
- /**
- * Copies nodes from one Directory to the other minus the excepts
- *
- * @param sourceRoot
- * is the source Directory to copy from
- * @param targetRoot
- * is the target Directory to copy to
- * @param excepts
- * is a list of Strings specifying what nodes NOT to copy
- * @deprecated POI 3.8 beta 5. Use {@link FilteringDirectoryNode} instead
- */
- public static void copyNodes( DirectoryEntry sourceRoot,
- DirectoryEntry targetRoot, List<String> excepts )
- throws IOException
- {
- FilteringDirectoryNode source = new FilteringDirectoryNode(sourceRoot, excepts);
- FilteringDirectoryNode target = new FilteringDirectoryNode(targetRoot, excepts);
- copyNodes( source, target );
- }
-
/**
* Copies all nodes from one POIFS to the other
*