title: MediaException: MEDIA_UNAVAILABLE - Java Project Path included
body: <p>I am working on a small hobby project (Media Player) with JavaFx but I have ran into a file object problem. I am getting the following error from the file chooser and it is returning the wrong path:</p>
  
  <blockquote>
    <p>Exception in thread "JavaFX Application Thread" MediaException:
    MEDIA_UNAVAILABLE :
    /Users/name/Documents/projects/java/PlayFx/file:/Users/name/Downloads/Girl%20Talk%20-%20All%20Day%20(IA123)/01%20-%20Girl%20Talk%20-%20Oh%20No.mp3
    (No such file or directory)</p>
  </blockquote>
  
  <p>I can identify the problem as so: </p>
  
  <p><strong>MP3 Location:</strong> file:/Users/name/Downloads/Girl%20Talk%20-%20All%20Day%20(IA123)/01%20-%20Girl%20Talk%20-%20Oh%20No.mp3</p>
  
  <p><strong>Project Location:</strong> /Users/name/Documents/projects/java/PlayFx/</p>
  
  <p>But I can't understand why the following line of code is concatenating the two together? What could be the cause for this?</p>
  
  <pre><code>File file = fileChooser.showOpenDialog(primaryStage);
  if (file != null)
  {
      try
      {
          player = new Player(file.toURI().toURL().toExternalForm());
          Scene scene = new Scene(player, 720, 535, Color.BLACK);
          primaryStage.setScene(scene);
      }
      catch (MalformedURLException e)
      {
          e.printStackTrace();
      }
  }//if
  </code></pre>