@@ -0,0 +1,653 @@
+package com.levelup.java.io;%0A%0Aimport java.io.File;%0A%0Aimport org.apache.log4j.Logger;%0Aimport org.junit.Test;%0A%0A/**%0A * This example will demonstrate how to%0A * check if a file exists in java.%0A * %0A * @author Justin Musgrove%0A * @see %3Ca href='http://www.leveluplunch.com/java/examples/check-if-file-exists/'%3ECheck if file exists%3C/a%3E%0A * %0A */%0Apublic class CheckIfFileExists %7B%0A%09%0A%09private static final Logger logger = Logger.getLogger(CheckIfFileExists.class);%0A%0A%09@Test%0A%09public void check_if_file_exists_java () %7B%0A%09%09%0A%09%09File file = new File(%22/readme.md%22);%0A%0A%09%09if (file.exists()) %7B%0A%09%09%09logger.info(%22File existed%22);%0A%09%09%7D else %7B%0A%09%09%09logger.info(%22File not found%22);%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

add check if file exists