I'm sure you could interrogate jFileIn to see if the URL was valid, but short of that, cfhttp to see if the file is there.
Ade -----Original Message----- From: Chad McCue [mailto:[EMAIL PROTECTED] Sent: 29 October 2004 13:32 To: CF-Talk Subject: Re: Java Question FileExists() isn't working for me when all I have is a Http:// address and don't have the absolute address. ----- Original Message ----- From: "Doug James" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Friday, October 29, 2004 8:24 AM Subject: Re: Java Question > Why not use cfif FileExists() first? > > Doug > > Chad McCue wrote: > > >I am using the following java code to get a image from a external server. > > > >where Arguments.FileLoc would be something like http://www.sitename.com/imagedir/imagename.jpg > > > ><cfset jFileIn = createObject("java","java.net.URL").init(ARGUMENTS.FileLoc)> > ><cfset inP = createObject("java","java.io.BufferedInputStream").init(jFileIn.openStream() )> > > > >The problem is, if the image does not exist, it throws this exception: java.io.FileNotFoundException. How can I test that the file exists using the openStream() function. I need to use a default image if file isn't found. > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community. http://www.houseoffusion.com/banners/view.cfm?bannerid=38 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182916 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54