Reputation:
I have a library that cannot accept InputStreams. It only accepts Files and URLs as input to load music. Is there any way to load a file that is in my resources folder without an InputStream? Or do I just need to create a separate folder for sounds and load them using
System.getProperty("user.dir") + path_to_file
Upvotes: 0
Views: 131
Reputation: 691755
Class[Loader].getResource()
returns a URL. Use this method to get a URL pointing to your classpath resource, and pass the URL to your library.
Upvotes: 1