You may try the following code:
public class TestParser{
public static void main(String[] args){
for(int i=0; i<Integer.parseInt(args[1]); i++)
{
File file = new File(args[0]+"/filename"+(i+1)+".xml");
doTestParser(file);
}
}
static void doTestParser(File pFile ){
//do something with the xml file
}
}
You should now execute only one time from the command line, e.g:
/>java Testparser <<file directory>> <<total file>>
Regards,
Putrama