title: Timer based file persistent connection in java
body: <p>Problem:
  I have an application in which frequent write operation is done in a day-wise file.I dont want to open-close file for every write.</p>
  
  <p>Approach:
  A timer based application will start at 12:01 am everyday and creates a Thread. In this thread, a file open connection will be created. So when a GET request comes for write operation, it will simply check if thread is running and write into the file. At next 12:01 am, previous thread will close file connection.</p>
  
  <p>Any suggestion to how to achieve this??
  I am new to Java. Pls help</p>