file input, correct while condition

add File file = new File(filepath);