title: How do I correct this silent failure to write files using Java IO?
body: <p>I am encountering a strange issue with the commons-io/java-io. Essentially my file creation is failing silently without an exception.</p>
  
  <pre><code>FileUtils.writeLines(file, collectionOfStrings);
  </code></pre>
  
  <p>I've looked through the commons code to try and figure why this failing silently, but to me it looks like it should be throwing an exception. (See lines 1338, 163 in <a href="http://svn.apache.org/repos/asf/commons/proper/io/tags/commons-io-1.4/src/java/org/apache/commons/io/FileUtils.java" rel="nofollow noreferrer">FileUtils.java</a> and line 927 in <a href="http://svn.apache.org/repos/asf/commons/proper/io/tags/commons-io-1.4/src/java/org/apache/commons/io/IOUtils.java" rel="nofollow noreferrer">IOUtils.java</a>.)</p>
  
  <p>In an effort to try to correct this issue, I added this check to the code after the previous line,</p>
  
  <pre><code>if (!file.exists()) {
      logger.warn("File creation failed.");
  }
  </code></pre>
  
  <p>However, even when file creation fails, this block is not being entered.</p>
  
  <p>I'm at my wits end with this one, can anyone with more experience with Java IO help me out?</p>