Templates features
New target languages
#set( $env.language = 'C++' )#set( $env.language = 'Scala' )Files usage
## Get a file :
#set( $file = $fn.fileFromBundle("foo.txt") )
#set( $file = $fn.fileFromModel("foo.txt") )
#set( $file = $fn.file("/foo/bar/foo.txt") )
## File information :
file.name : $file.name
file.parent : $file.parent
file.path : $file.path
file.absolutePath : $file.absolutePath
file.canonicalPath : $file.canonicalPath
file.exists() : $file.exists()
file.isFile() : $file.isFile()
file.isDirectory() : $file.isDirectory()
file.isHidden() : $file.isHidden()
file.length : $file.length
## Load file content :
#set($content = $file.loadContent() )
#set($lines = $file.loadLines() )
#if( $file.exists() && $file.isFile() )
$file.loadContent(2)## NO EOL
#end
#foreach ( $line in $file.loadLines(3) )
. $line
#end
## CSV file
#set( $file = $fn.fileFromBundle("enum-csv.txt") )
#set( $lines = $file.loadValues(",", 1) )
#foreach ( $line in $lines )
$line.get(0) : $line.get(1)
#elseJava JPA improvements
#cancel directive
Last updated