I'd move
System.getProperty("line.separator")
outside of the loop and have it store the value in a local variable instead of calling the method each time around the loop.