Example 2

Copy all XML files in d1 to d2. Note that this do not copy the contents of any of d1's subdirectories since the directories in d1 are made invisible by the view filter.

JavaScript

new TreeCopyTF(). addSource(d1.newView(new EFileNameExtensionFilter("xml"))). setTarget(d2).run();

Example 3

Copy all XML files in d1:s directory hierarchy to a directory hierarchy under d2. Note that his copies all the directories in d1's hierarchy, even those that don't contain any XML files.

JavaScript

new TreeCopyTF(). addSource(d1.newView( DirectoryFilter.FILTER.or( new EFileNameExtensionFilter("xml")))). setTarget(d2).run();

Example 4

Copy all XML files in d1:s directory hierarchy to a directory hierarchy under d2. This does not create any directories at the target location that don't contain any XML files (or subdirectories with XML files).

JavaScript

new TreeCopyTF(). addSource(new DirectoryAndFilter(d1, new EFileNameExtensionFilter("xml"))). setTarget(d2).run();

Example 5

Copy all XML files in d1:s directory hierarchy to a directory hierarchy under d2. Don't copy directories that don't contain any XML files. (This example does exactly the same as the previous example.)

JavaScript

new RecursiveProcessTF(). addSource(new DirectoryAndFilter(d1, new EFileNameExtensionFilter("xml"))). setTarget(d2). setTaskFactory( new CopyTF()).run();


* An EntityFS-aware task is implemented using EntityFS. This means that it uses the filter settings of DirectoryView:s and also that it often can work with other file system implementations than File-based, such as the RAM file system.