The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Automate files input

Overview: I am creating automated assignment marking system, in which the goal is: suppose there are 100 students' assignments in a directory and if I start my program it should check all of the assignment.java one by one and generate a report based on that.

Clearer explanation of the question:
At the moment, I have got assignment.java of 1 student and my Testing.java (which creates an object of the class in assignment.java and generates a report based on the output of assignment.java). So, till now what I am able to achieve is: Inside the Test project (which contains Testing.java), I import assignment.java; run the Testing.java and generate the report. When it comes to second student, I remove previous assignment.java import new assignment2.java(second student); run the Testing.java, which uses the students program and generates the report.

What I want to achieve is, In my Testing.java instead of importing assignments one by one and marking them, I want to automate it. i.e. In my Testing.java, if I specify the path of the directory in which all assignments are placed, my system should automatically overwrite (import new assignment removing the older) assignment.java and generate a report based on that.