Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to open external files ?

 
Phone Myat Kyaw
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm doing this project as my school assignment. I've done as much as I can for all the source codes part without having tested because I'm having problems to open and access Mxx.mp3 files. I'm using NetBeans and I put all the files under "music" folder and put that folder into "src" folder under the NetBeans project directory.
When I compile, it just keep saying "the file path is undefined" (or something similar to this meaning). I've tested it with prepending "./" + filename but still cannot.

Can someone help me, please ?

thanks in advance
 
Abhijit Rai
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi could you provide some additional info :
1.Whether the project is a web application deployed on the server or a standalone java apllication
2.In case of it being a web application ,the directory structure of the application , present in the server where it is deployed.
 
Phone Myat Kyaw
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhijit Rai wrote:Hi could you provide some additional info :
1.Whether the project is a web application deployed on the server or a standalone java apllication
2.In case of it being a web application ,the directory structure of the application , present in the server where it is deployed.


Sorry for being delayed.
1. It's stand alone Java application. Hence, the file structure is simple and as usual of a NetBeans Project.

I put all MXX.wav files under "measures" folder and put that folder under "src" folder. When I compile, got this error message (compilation is successful but cannot run)

"java.io.FileNotFoundException: ..\measures\M96.wav (The system cannot find the path specified)"

This is my method adding the file names into an arraylist.



I've tried without ".." (current directory), but still cannot.

To be able to play, I'm provided a file called StdAudio.class which will read and play the files from the arraylist. I don't have to do anything except building the filenames and calling them properly.

Can someone enlighten me how-to ? If you wish to try and help my case, feel free to ask for the whole files(source codes).

please, appreciate your help !!!
 
Campbell Ritchie
Sheriff
Pie
Posts: 49733
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Current directory" isn't .. but . The .. means one directory up the hierarchy.
 
Phone Myat Kyaw
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:"Current directory" isn't .. but . The .. means one directory up the hierarchy.


uh ok ! I'll try again when I get back home...thanks !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic