Oct 31

The Class class has methods for looking up resources using the class loader.

For example to find the URL of the file myresource.txt in the same directory as MyClass.class you would use the following (this requires that MyClass.class is available in the classpath)

URL resource = MyClass.class.getResource("myresource.txt");

written by objects \\ tags: , ,

Leave a Reply

You must be logged in to post a comment.