title: Caused by: java.io.FileNotFoundException: /path/somthing.jar (Is a directory) when FileOutputStream object is created
body: <p>this is a really basic one, but it got me scratch my hear for 4 hours, now i'm giving up.
  to give as much as possible information , i can say it's a java webapp project with zk 5.0.8 as frontend+spring+hibernate+maven  under ubuntu 11.04 with permission to the basedir set to 777.</p>
  
  <p>tried the file upload everything seems to be ok and where i have confidence that my code is correct it's just not working.</p>
  
  <p>here is the code </p>
  
  <pre><code>private boolean saveUploadledFile(Media uploadedMedia, String basedir) {
  
      String code = codeGenerator.generateContentCode(15);
      String FINAL_DIR_PATH = basedir + "/"+"Racing" + "/" + code;
      String FINAL_FILE_PATH = FINAL_DIR_PATH + "/" + uploadedMedia.getName();
      alert(FINAL_DIR_PATH);
      try {
          File finaldir = new File(FINAL_DIR_PATH);
          //apache commons
          FileUtils.forceMkdir(finaldir);
          alert("Size equals" + uploadedMedia.getByteData().length);
          fout = new FileOutputStream(new File(FINAL_DIR_PATH+"/"+addContentWindow1$txtName.getText()+".jar"));
            //apache commons
            IOUtils.copy(uploadedMedia.getStreamData(), fout);
  
      } catch (IOException e) {
          throw new RuntimeException(e);
      } catch (Exception e) {
          throw new RuntimeException(e);
      } finally {
          try {
              IOUtils.closeQuietly(in);
              IOUtils.closeQuietly(fout);
  
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
      }
  
      return false;
  }
  </code></pre>
  
  <p>new FileOutputStream always throws exceptions. so if i can't specify where i want to save how to save the files. any ideas? i intentionally output the size of the file to make sure there is a file. Can anyone shed some light? thanks for reading this</p>
  
  <p>the actual exception is </p>
  
  <blockquote>
    <p>Caused by: java.io.FileNotFoundException: /joseph/mbcs/Games/Racing/20314/somthing.jar (is a directory)</p>
  </blockquote>