code: public static long copy(InputStream inputStream, File baseDir, String fileName) throws FileNotFoundException, IOException
    {
      return copy(inputStream, new FileOutputStream(new File(baseDir, fileName)));
    }
docs: Copy bytes from given input stream to file denoted by requested base directory and file name. Destination file is
  create by {@link File#File(File, String)}. This method tries to create destination file and throws exception if
  fails.
  
  @param inputStream source bytes stream,
  @param baseDir destination base directory,
  @param fileName destination file name.
  @return the number of bytes processed.
  @throws FileNotFoundException if given <code>baseDir</code> and <code>fileName</code> does not denote and existing
  file and cannot be created.
  @throws IOException if bytes transfer fails.