Example 2

Emulate the dos2unix command and convert all text files in the directory hierarchy under d, putting the new files in a directory hierarchy under dp.

JavaScript

new RecursiveProcessTF(). addSource(new DirectoryAndFilter(d, new EFileNameExtensionFilter("txt"))). setTarget(dp). setTaskFactory( new FormatCharacterFileTF(). setInputEncoding("windows-1252"). setOutputEncoding("UTF-8"). setEolStyle(EolStyle.UNIX)).run();

Example 3

Emulate the dos2unix command and convert all text files in the directory hierarchy under d, overwriting the old files.

JavaScript

new RecursiveActionTF(). addSource(new DirectoryAndFilter(d, new EFileNameExtensionFilter("txt"))). setTaskFactory( new ReplaceSourceFileTF(). setTaskFactory( new FormatCharacterFileTF(). setInputEncoding("windows-1252"). setOutputEncoding("UTF-8"). setEolStyle(EolStyle.UNIX))).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.