Révision 3755

TXM/trunk/bundles/org.txm.core/src/java/org/txm/importer/ApplyXsl2.java (revision 3755)
372 372
	 * @return the source files of a directory
373 373
	 */
374 374
	public static File[] listFiles(File srcdir) {
375
		
375 376
		File[] files = srcdir.listFiles(new FileFilter() {
376 377
			
377 378
			@Override
......
391 392
				return true;
392 393
			}
393 394
		});
395
		
394 396
		return files;
395 397
	}
396 398
	
......
421 423
				builder.setParam(name, params.get(name));
422 424
			
423 425
			File[] files = listFiles(srcdir); // get files XSL compatible
424
			if (files == null) return false;
425
			
426
			if (files == null || files.length == 0) {
427
				System.out.println("No XML files to process found in: "+srcdir);
428
				return false;
429
			}
426 430
			System.out.println("-- Applying '" + xslFile + "' XSL to " + files.length + " files from  directory '" + srcdir + "' with parameters: " + params + " result written in '" + outdir + "'");
427 431
			
428 432
			ConsoleProgressBar cpb = new ConsoleProgressBar(files.length);
......
489 493
			for (String name : params.keySet())
490 494
				builder.setParam(name, params.get(name));
491 495
			
492
			if (files == null) return false;
496
			if (files == null || files.length == 0) {
497
				System.out.println("No XML files to process.");
498
				return false;
499
			}
493 500
			
494 501
			System.out.println("-- Applying " + xslFile + " XSL to " + files.length + " files with parameters: " + params);
495 502
			

Formats disponibles : Unified diff