Read text from a file in the Java project

anhchang_pcit

New Member
I'm using Java to write a music player that will take in a .abc file containing a piece of music in abc format and play it.I currently have it set up so the input is a filepath (via FileReader/BufferedReader). However, the filepath is particular to my computer and so the unit tests I wrote will fail on other computers. So the question is:How do I have a Java class read text from a file that is in the same project? So for example, if anybody clones into the repository I'm pushing to they can run the unit tests unmodified and have them pass.Any other suggestions about how to get around this issue will be appreciated.
 
Back
Top