Revision 2769 tmp/org.txm.groovy.core/src/groovy/org/txm/macro/nlp/TT2XMLInDirectoryMacro.groovy

TT2XMLInDirectoryMacro.groovy (revision 2769)
26 26
	
27 27
	XMLOutputFactory factory = XMLOutputFactory.newInstance()
28 28
	
29
	for (File inputfile : inputDirectory.listFiles().sort()) {
29
	def files = inputDirectory.listFiles()
30
	if (files == null || files.length == 0) {
31
		println "Error: no file to process in $inputDirectory"
32
		return false;
33
	}
34
	for (File inputfile : files.sort()) {
30 35
		if (inputfile.isDirectory() || inputfile.isHidden() || !inputfile.getName().endsWith(".tt")) continue // ignore
31 36
		println " file: "+inputfile
32 37
	

Also available in: Unified diff