Taking a stab even though I've never used any of that really...when you give the ClassLoader the name of the resource, it know where to find it, and gives you the URL so that you can get ahold of it directly. So then you get a file handle to it based on that URL...
I didn't check any of the other code, but that getFile() method did jump out at me...just want you to be sure that file is a String, not a File, because it looks like the getFile() method returns a String of the file's name: http://java.sun.com/j2se/1.3/docs/api/java/net/URL.html [ February 01, 2005: Message edited by: Stephen Huey ]
Sounds right, but I haven't used those much either. Normally, getResource(String) is used to locate a file (image, properties, etc) in the classpath. But beware that sometimes that resource is packaged up into a JAR on the classpath. In that case, the URL returned will have a "#resource" at the end, meaning it won't point to a file but rather a resource inside a file.
In other words, that code will not work if the resource is in a JAR. There is, of course, one way to find out . . . try it!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com