title: Cannot resolve symbol 'IOUtils'
body: <p>I have used the following code to create a temporary file in my android app:</p>
  
  <pre><code>public File streamToFile (InputStream in) throws IOException {
      File tempFile = File.createTempFile("sample", ".tmp");
      tempFile.deleteOnExit();
      FileOutputStream out = new FileOutputStream(tempFile);
      IOUtils.copy(in, out);
      return tempFile;
  }
  </code></pre>
  
  <p>Now the problem is <code>Cannot resolve symbol 'IOUtils'</code>. I did a little bit of googling and discovered that for  using IOUtils I need to download and include a jar file. I downloaded the jar file from <strong><a href="http://commons.apache.org/proper/commons-io/download_io.cgi" rel="noreferrer">here</a></strong>(<a href="http://www.poolsaboveground.com/apache//commons/io/binaries/commons-io-2.4-bin.zip" rel="noreferrer">commons-io-2.4-bin.zip</a>). I added the jar named <code>commons-io-2.4.jar</code> from the zip to my bundle and when I tried to import it using:</p>
  
  <pre><code>import org.apache.commons.io.IOUtils;
  </code></pre>
  
  <p>It is showing error <code>Cannot resolve symbol 'io'</code>. So I tried to import it like:</p>
  
  <pre><code>import org.apache.commons.*
  </code></pre>
  
  <p>But still I am getting the error <code>Cannot resolve symbol 'IOUtils'</code>.</p>
  
  <p>Question 1 : Why am I getting this error? How to resolve it?</p>
  
  <p>Question 2 : Is there any way to create a temp file from an InputStream without using an external library? Or is this the most efficient way to do that? I am using android studio.</p>