]> source.dussan.org Git - poi.git/commitdiff
show example of equivalent EntryUtils.copyNodes using FilteringDirectoryNode instead...
authorJaven O'Neal <onealj@apache.org>
Wed, 2 Nov 2016 16:22:04 +0000 (16:22 +0000)
committerJaven O'Neal <onealj@apache.org>
Wed, 2 Nov 2016 16:22:04 +0000 (16:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1767715 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/poifs/filesystem/EntryUtils.java

index 5f473dbe1e9d070cc49d4d492cecd2981e3101ff..a4b452f4b874a0834f54e1e11cd827ec531deebd 100644 (file)
@@ -105,15 +105,9 @@ public class EntryUtils
             DirectoryEntry targetRoot, List<String> excepts )
             throws IOException
     {
-        Iterator<Entry> entries = sourceRoot.getEntries();
-        while ( entries.hasNext() )
-        {
-            Entry entry = entries.next();
-            if ( !excepts.contains( entry.getName() ) )
-            {
-                copyNodeRecursively( entry, targetRoot );
-            }
-        }
+        FilteringDirectoryNode source = new FilteringDirectoryNode(sourceRoot, excepts);
+        FilteringDirectoryNode target = new FilteringDirectoryNode(targetRoot, excepts);
+        copyNodes( source, target );
     }
 
     /**