Last night, I made a quick post about getting all the classes available in a JAR file using ColdFusion. I went about this using a JarInputStream. Thankfully Todd Sharp and Simon Free reminded me that ColdFusion's CFZip tag can read JAR files as well as ZIP archives. Using ColdFusion's CFZip tag actually makes my GetJarClasses() much more simple:
Launch code in new window » Download code as text file »
Sometimes you forget how easy ColdFusion makes random tasks. Thanks guys for the reminder!
Download Code Snippet ZIP File
Comments (3) | Post Comment | Ask Ben | Permalink | Print Page
KinkyTwits - My ColdFusion And jQuery Powered Twitter Client
Listing All Classes In A Jar File Using ColdFusion
Right on. The fun part about using cfzip is that if you leave it as a query object you can use QofQ to do quick searches to find a specific class (or just snoop around). If I'm really bored I'll snoop around the internal CF Jar files using that method.
Posted by todd sharp on Oct 3, 2008 at 9:38 AM
@Todd,
You never have to sell me on the power of queries :)
Posted by Ben Nadel on Oct 3, 2008 at 9:39 AM
Hello Ben,
I had to change the following lines to make it work
<!--- Define the local scope. --->
<cfset var LOCAL = {} />
<!--- Create a default array of classes. --->
<cfset LOCAL.Classes = [] />
to
<!--- Define the local scope. --->
<cfset var LOCAL =structNew() />
<!--- Create a default array of classes. --->
<cfset LOCAL.Classes = arrayNew(1) />
I am using CFMX7
Posted by Bijan Atri on Nov 18, 2008 at 10:26 AM