title: Why does java.io.File not implement Autocloseable?
body: <p>After upgrading to Java 7 I get the following code flagged by Eclipse:</p>
  
  <pre><code>    try (File file = new File(FILE_NAME)) {
          file.delete();          
      }
  </code></pre>
  
  <p>Error is: </p>
  
  <blockquote>
    <p>The resource type File does not implement java.lang.AutoCloseable</p>
  </blockquote>
  
  <p>And Java's documentation doesn't have File listed in the AutoCloseable docs:
  <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html" rel="noreferrer">http://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html</a></p>
  
  <p>So besides adding the catch block, what is the suggested alternative?</p>