cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
65
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: null on 21-12-2005 07:42:45 PM
In a custom Audium action I'm trying to execute the following code in order to get an InputStream from a file that I've placed in the java/application/classes folder:

InputStream inStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("credentialing_codes.xml");

No matter what I seem to do I'm getting a null exception when I try to access that InputStream. Am I grabbing the right classloader from my app?

Subject: RE: ClassLoader Issues?
Replied by: Vance Vagell on 21-12-2005 10:52:57 PM
Hi Rich,

The Audium Java API includes a mechanism by which to resolve the path of files such as your XML file, without having to hard-code a path. We recommend that you use the getApplicationDirectory() method of the APIBase class, which will return your application's actual path, such as:

/usr/local/Audium/applications/MyApp/

Using this approach, you could store your XML file in the data/misc folder, which is the intended location for such assets. For additional information about this method, please refer to the Audium Java API Javadocs.

Regards,
Vance
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links