Framework resources folder and Maven
Framework resources folder and Maven
- Subject: Framework resources folder and Maven
- From: Ramsey Gurley <email@hidden>
- Date: Tue, 12 Apr 2016 13:47:08 -0700
I have an application with a business logic framework, and in that framework there is a Resources/known_hosts file. I’ve discovered that with maven, ERXFileUtilities.pathForResourceNamed just returns null and logs out “Can’t get path when run as jar: …”.
In this case, I’m using the JSch library to do SFTP, and that happens to accept a path or an input stream for the known hosts file. So I switch to ERXFileUtilities.inputStreamForResourceNamed, and I still get a null return value. It just fails silently.
So I put together a test case and stepped through until I get to the point where it tries to load the known_hosts file. What I discover is that my business logic framework isn’t listed in NSBundle.allBundles() or even NSBundle._allBundlesReally(). Since the bundle isn’t found, it checks the WOA for Resources/known_hosts instead.
Moving the known_hosts up to the app seems to work.
Is there some proper way to access files in a dependent framework’s Resources, or does this sound strange to the maven people?
Thanks,
Ramsey
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden