title: java.util.logging check if file exist in java
body: <p>I am using java's <code>java.util.logging</code> api for logging messages in my java application.as of now each time file is getting created when application starts. i want to check if file exist then append content to that file</p>
  
  <p>code :</p>
  
  <pre><code>public static Logger logger;
  static FileHandler fh;
  
  logger = Logger.getLogger("Log");
  logger.setUseParentHandlers(false);     
  
  String sFileName = new SimpleDateFormat("dd-MMM-yyyy").format(new Date());
  
  fh = new FileHandler(sPath + "//" + sFileName + ".txt");
  logger.addHandler(fh);
  
  SimpleFormatter formatter = new SimpleFormatter();
  fh.setFormatter(formatter);
  </code></pre>
  
  <p>after this i called below line to get message into <code>.txt</code> file</p>
  
  <pre><code>Classname.logger.info("---START LOGGING----");
  </code></pre>
  
  <p>As my code does not use <code>file.open()</code> method, i cant go for <code>file.exists()</code> call.</p>