The last few days, my production webserver has had an issue with Java 
unable to create cache files. This is triggered when firing a <cfimage> 
tag, pointing at a graphic file in the filesystem, the purpose of which 
is to retrieve the width/height values.

As best I can tell (as this is generally outside my area of expertise), 
the issue is the default directory Java uses for this purpose has a) 
vanished or b) had its permissions reset to disallow access.

The trick is, I don't know how to determine what this default directory 
is, to then check the filesystem to see what's what.

I am able (using CF and createObject) tap into the Java method 
getCacheDirectory(), but the issue there is if this value isn't 
specifically set (i.e. the default is used), it returns a null value, 
and not the actual directory path being used. And I'm getting said null 
value, so that's of no help.

I'm trying to use another method, setCacheDirectory(), to specifically 
set that value to a given location - but I cannot puzzle out the CF 
syntax to make this work.

Below is the code I'm using to tap the getCacheDirectory() method, and 
what's not working on setCacheDirectory(). I'm creating an object to the 
"File" class first, to use for the "get" call, and then (as best I can 
tell according to some Java docs at Oracle) I need to reference that 
class in the "set" call.

<cfset objFile = createObject("java", 
"java.io.File").init(expandPath("/"))/>
free space: #objFile.getFreeSpace()#   (returns free space on server drive)

<cfset  objImageIO = createObject("java", "javax.imageio.ImageIO") />
cache directory: #objImageIO.getCacheDirectory()#    (returns null value)
usecache: #objImageIO.getUseCache()#    (returns true - true means file 
caching, false means memory caching)

<cfset x = objImageIO.setCacheDirectory(objFile, 
'/var/www/nnd/htdocs/imageCache/') >
This call fails with "The setCacheDirectory method was not found."

Basically I'm stumped on the syntax of the last call. I'm not even sure, 
should I get this worked out and the call is successful, that it will 
solve the cache-failing issue, but it's my best lead so far.

Any assistance on this syntax problem would be greatly appreciated!
--Scott

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359109
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to