title: check file exists java
body: <p>I want create text file but if the file already exists it should not create new file but should append the text to the content (at the end) of the existing file. How can I do it in Java?</p>
  
  <p>for every one second I'm reading data from inputstream when i stop reading and again i start reading data at that time i should write to same file if file already exist</p>
  
  <p>does I have to check the condition:</p>
  
  <pre><code>if(file.exists){
  
  } else{
     new File();
  }
  </code></pre>
  
  <p>What I have to do?</p>