Created
June 23, 2012 21:53
-
-
Save isapir/2980206 to your computer and use it in GitHub Desktop.
prints a list of jars found in a class path of a class loader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="printClassLoaderUrls" output="true"> | |
<cfargument name="classLoader"> | |
<cfset var Local = {}> | |
<cfset PAD = " "> | |
<p><b>#classLoader.getClass().getCanonicalName().toString()#</b> | |
<cftry> | |
<cfset Local.urls = classLoader.getURLs()> | |
<cfloop array="#Local.urls#" index="Local.ai"> | |
<br>#PAD# #Local.ai.toString()# | |
</cfloop> | |
<cfcatch> | |
<p class="error">#PAD# #cfcatch.toString()#; passed classLoader does not have a getURLs() method</p> | |
<cfdump var="#classLoader#" label="classLoader"> | |
</cfcatch> | |
</cftry> | |
</cffunction> | |
<cfset printClassLoaderUrls( getPageContext().getClass().getClassLoader().getSystemClassLoader() )> | |
<cfset printClassLoaderUrls( getPageContext().getServlet().getClass().getClassLoader() )> | |
<cfset printClassLoaderUrls( getPageContext().getConfig().getClassLoader() )> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment