import java.io.*; File indexHtml = new File( basedir, "target/site/index.html" ); if ( indexHtml.exists() ) { throw new Exception( "Detected unwanted file " + indexHtml ); } return true;