This series of commented screenshots describes some file processing tasks and how to perform them with the File Piper tool.
Suppose you have a very big log file and you want to have only the 1000 last lines of this file copied in another file. This is the purpose of the tail processor:
Here the multiplicity is one everywhere, we selected only one input file and one ouput file is created.
Notice that here, the "proposed" output file name was chosen. It means that the processor will choose the name of the output file based on the input file name. The "tail" processor just adds a "_tail" suffix to the input file name, it means that, in this case, the output file name will be "server_tail.log".
Suppose you want to copy one of your development project to another location in order to use it as a basis for some code experimentation. In this case, you want to copy all the needed source and configuration files but not the build result nor the source control (in this case subversion) support files.
In a typical maven project, all build result are under the ./target directory. With subversion, all control files are under a .svn directory. So you just have to ignore everything that is below a target or .svn directory.
When copying, the tool takes the directory structure found under the source "base directory" and reproduce it under the destination "target directory". In this case, the "Current" output file name is choosen to avoid adding a suffix to the name of every copied file.
For example, in your application you have a problem with a property named "parser.pool.class". You don't know where it is defined and what is its actual value but guessed that is is defined somewhere in jar file of a library used by your application. So, you want to search the property in all the jar files used by your application.
To do that with the File Piper, you must combine two processors: the 'unzip' to deflate the jar files and the 'search' to search the property.
In this example the jars are in the "C:\MavenRepo\org\apache" directory (in fact it's all the apache projects that are in my local maven repository). The result of the search is shown on the console; the execution gives:
C:\MavenRepo\org\apache\SearchResult.txt --------------------------------------------------------------------------------- Search Litteral for: parser.pool.class Line by line In files below C:\MavenRepo\org\apache Including **/*.jar --------------------------------------------------------------------------------- File C:\MavenRepo\org\apache\velocity\velocity\1.5\velocity-1.5.jar#org\apache\velocity\runtime\RuntimeConstants.class at line 6: ISO-8859-1___runtime.introspector.uberspect introspector.restrict.packages___introspector.restrict.classes... File C:\MavenRepo\org\apache\velocity\velocity\1.5\velocity-1.5.jar#org\apache\velocity\runtime\RuntimeInstance.class at line 107: SourceFile___RuntimeInstance.java__java/lang/ClassNotFoundException___java/lang/NoClassDefFoundError__1org/apache/commons/collections/ExtendedProperties... File C:\MavenRepo\org\apache\velocity\velocity\1.5\velocity-1.5.jar#org\apache\velocity\runtime\defaults\velocity.properties at line 153: parser.pool.class = org.apache.velocity.runtime.ParserPoolImpl found 3 files out of 6336
where the third match is what we are looking for.