aspose file tools*
The moose likes Beginning Java and the fly likes how to open external files ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to open external files ?" Watch "how to open external files ?" New topic
Author

how to open external files ?

Phone Myat Kyaw
Ranch Hand

Joined: Dec 26, 2008
Posts: 31
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

Joined: Aug 07, 2008
Posts: 41
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.


SCJP5 ,SCWCD5
Phone Myat Kyaw
Ranch Hand

Joined: Dec 26, 2008
Posts: 31
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

Joined: Oct 13, 2005
Posts: 36508
    
  16
"Current directory" isn't .. but . The .. means one directory up the hierarchy.
Phone Myat Kyaw
Ranch Hand

Joined: Dec 26, 2008
Posts: 31
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 !
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to open external files ?
 
Similar Threads
Adding external libraries on J2MEWTK
Can't access/call class/method in java class which is compile by using netbeans
Jar file creation and .wav files
Maven src and netbeans
copy netbeans project fiel