what's the best way to access resource files in java?
I am just trying some java3d examples and it uses a resource loader that creates an URL object with the file name,but i can't get it to work, any suggestions?
Name:
Anonymous2006-04-18 13:41
Ok, I guess i have to be more especific, it makes a call to class.getResource(filename), that should return a valid URL handler, but it returns null. I am not sure how does this call search the path of the resources.
Name:
Anonymous2006-04-18 14:04
>>1
new MacroResourceFactory().getResourceAccessor().loadResource(new ResourceParserFactory().get().parse(new BufferedReader(new FileReader("your file"))))
Name:
Anonymous2006-04-18 14:04 (sage)
Asking for Java help? In /prog/?
Name:
Anonymous2006-04-18 14:22
>>4
Let's not start the trolling, it may suck, but it's still a programming language...
>>1
That's very easy, you just have to do: Stream s = new Stream();
InputStream is = new InputStream(s);
BufferedInputStream bis = new BufferedInputStream(is);
BufferedInputStreamAccess bisa = new BufferedInputStreamAccess();
BufferedInputStreamAccessResource bisar = new BufferedInputStreamAccessResource();or something, maybe you should read the javadoc...
Name:
Anonymous2006-04-21 9:08
BufferedInputStreamAccessResource bisar = new BufferedInputStreamAccessResource();
a real java programmer would write it like this: BufferedInputStreamAccessResource MyBufferedInputStreamAccessResouceWithANameThatIsSeventyFiveCharactersLong = new BufferedInputStreamAccessResource();
Name:
Anonymous2006-04-21 12:36
>>10
NullPointerException!!! Game over! Play again? (y/n)