title: Findbugs "Method ignores exceptional return value" java.io.File.mkdirs()
body: <p>I have the following code in my app: </p>
  
  <pre><code>final File f = new File(path);
  
  try {
      boolean folderCreated = f.mkdirs();
  
      // if dir wasn't created this time, and doesn't exist
      if (!folderCreated &amp;&amp; !f.exists()) {
          throw new IOException("Unable to create path");
      }
  } catch (SecurityException e) {
              throw new IOException("Unable to create path");
  }
  </code></pre>
  
  <p>When I run findbugs (in Android Studio), it reports <code>Bad Practice</code> <code>Bad use of return value from method</code> <code>Method ignores exceptional return value of java.io.File.mkdirs()</code></p>
  
  <p>Javadoc states that <code>java.io.File.mkdirs()</code> returns true if the directory was created, or false on failure OR if the directory already existed, hence the <code>!f.exists()</code> check.</p>
  
  <p>I don't want to ignore findbugs messages - not even warnings, but I don't see how I can resolve this as the return value is clearly being checked.</p>
  
  <p>Note, I added the <code>try{...}catch (SecurityException){...}</code> as a suggestion from this post: <a href="https://stackoverflow.com/a/23631948/1423896">https://stackoverflow.com/a/23631948/1423896</a>, but it doesn't make any difference.</p>