On Fri, Aug 15, 2008 at 3:21 PM, Barney Boisvert wrote:
> You could attempt to load one of it's classes and catch the resulting
> exception if it's missing. Based on whether that exception is raised
> you'll know whether it's available.
Yes, that sounds like a good way to do it.
FWIW, when I've been utilizing java libraries that I may load through
a classloader, I try to abstract the object creation, so I can switch
between classloaded classes or classes already loaded in the
classpath.
I've generally used logic of the type "if a classloader is passed in,
use it, otherwise, use plain old createObject("java"...", vs. just
trying and catching, which sounds like a better approach, perhaps.
I've actually got some iCal4j specific code, if you're curious.
~Den
--
Few of the many wise apothegms which have been uttered have prevented
a single foolish action.
Thomas B. Macaulay
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311116
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4