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=36
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182911
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54