currently it's not possible to set the number of generated records in runtime. Luckilly there's a workaround. Set the number of records to be generated by the DataGenerator to a number that you think will always be larger than will really want to generate (number of listed files in your case). Then in the generator code, first send the filenames to the output as separate records. When you run out of filenames, return RecordGenerate.SKIP for all following requests to generate output. With this the generator will generate exactly the number of records as is the number of filenames. It's a bit innefective at the end because of the skipping, but skipping is very fast so it shouldn't be a problem.
We didn't try debugging of the Java transformation, but it should work if you use remote debugging, see:http://www.eclipsezone.com/eclipse/forums/t53459.html
In the above article, you can see command line arguments that need to be passed to the executed graph (via its Run Configuration) and then how to configure the Eclipse debugger. One important thing - you'll need to use external Java tranformations, i.e. write the Java transformation in separate file (in "trans" directory) and specify its classname in DataGenerator configuration.
However, we're looking into improving debugging of Java transformations - please see issue CLD-3092 in out bugtracker (bug.javlin.eu).