Re: Testing for existence of Java library?

2008-08-15 Thread Barney Boisvert
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.

cheers,
barneyb

On Fri, Aug 15, 2008 at 2:19 PM, Pete Ruckelshaus
<[EMAIL PROTECTED]> wrote:
> Hopefully simple question.  How would I test for the existence of a specific
> Java library (specifically, iCal4j)?
>
> Thanks
>
> Pete
>
>
> 

~|
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:311058
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Testing for existence of Java library?

2008-08-15 Thread Dave Watts
> Hopefully simple question.  How would I test for the 
> existence of a specific Java library (specifically, iCal4j)?

Use an exception handler around your CreateObject call.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
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:311059
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Testing for existence of Java library?

2008-08-15 Thread Brad Wood
You mean, like check to see if the jar exists?

I've never found a way to do it without simply trying to create an instance 
of it in a try catch block.

~Brad

- Original Message - 
From: "Pete Ruckelshaus" <[EMAIL PROTECTED]>
To: "CF-Talk" 
Sent: Friday, August 15, 2008 4:19 PM
Subject: Testing for existence of Java library?


> Hopefully simple question.  How would I test for the existence of a 
> specific
> Java library (specifically, iCal4j)?


~|
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:311060
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Testing for existence of Java library?

2008-08-15 Thread Andrew Scott
I don't know but maybe something like this

Try {
Var test = new Ext.GridPane();
} catch (e) {
// Library not found
}

I suppose you don't think like that?




-- 
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613 9015 8628
Mobile: 0404 998 273




-Original Message-
From: Pete Ruckelshaus [mailto:[EMAIL PROTECTED] 
Sent: Saturday, 16 August 2008 7:19 AM
To: CF-Talk
Subject: Testing for existence of Java library?

Hopefully simple question.  How would I test for the existence of a specific
Java library (specifically, iCal4j)?

Thanks

Pete




~|
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:311082
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Testing for existence of Java library?

2008-08-15 Thread James Holmes
Not when someone asks a Java question and not a JavaScript question.

On Sat, Aug 16, 2008 at 12:21 PM, Andrew Scott
<[EMAIL PROTECTED]> wrote:
> I don't know but maybe something like this
>
> Try {
>Var test = new Ext.GridPane();
> } catch (e) {
>// Library not found
> }
>
> I suppose you don't think like that?

-- 
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

~|
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:311087
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Testing for existence of Java library?

2008-08-15 Thread Andrew Scott
Pseudo code dude..

The solution is the same is it not?





-- 
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613 9015 8628
Mobile: 0404 998 273




-Original Message-
From: James Holmes [mailto:[EMAIL PROTECTED] 
Sent: Saturday, 16 August 2008 4:08 PM
To: CF-Talk
Subject: Re: Testing for existence of Java library?

Not when someone asks a Java question and not a JavaScript question.

On Sat, Aug 16, 2008 at 12:21 PM, Andrew Scott
<[EMAIL PROTECTED]> wrote:
> I don't know but maybe something like this
>
> Try {
>Var test = new Ext.GridPane();
> } catch (e) {
>// Library not found
> }
>
> I suppose you don't think like that?

-- 
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/



~|
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:311088
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Testing for existence of Java library?

2008-08-16 Thread denstar
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:36
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4