title: Before creating the file , deleting the file of previous day
body: <p>I am creating a dat file in C: drive folder named abc as shown below , Now my file is generated everyday
  now suppose if my file is generated today, then tommrow it will be also generated as usual
  but when tommrow it is generated I have to make sure that earlier day file is deleted as the space in that folder is limited and this check is every time need to be done previos day file to be get deleted from that folder , please advise how to achieve this..</p>
  
  <pre><code>File file = new File(FilePath + getFileName()); //filepath is being passes through //ioc         //and filename through a method 
  
  
          if (!file.exists()) {
              file.createNewFile();
          }
  
  FileOutputStream fileOutput = new FileOutputStream(
                  file);
  
          BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
                  fileOutput));
  </code></pre>