MNG-2827 pull the entry from the expression documenter using a method that works from the command line and in an embedded environment.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@512860 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2007-02-28 17:32:23 +00:00
parent 9d1ee49281
commit 37692fbea1
1 changed files with 1 additions and 27 deletions

View File

@ -139,32 +139,6 @@ public class ExpressionDocumenter
private static ClassLoader initializeDocLoader()
throws ExpressionDocumentationException
{
String myResourcePath = ExpressionDocumenter.class.getName().replace( '.', '/' ) + ".class";
URL myResource = ExpressionDocumenter.class.getClassLoader().getResource( myResourcePath );
String myClasspathEntry = myResource.getPath();
myClasspathEntry = myClasspathEntry.substring( 0, myClasspathEntry.length() - ( myResourcePath.length() + 2 ) );
if ( myClasspathEntry.startsWith( "file:" ) )
{
myClasspathEntry = myClasspathEntry.substring( "file:".length() );
return ExpressionDocumenter.class.getClassLoader();
}
URL docResource;
try
{
docResource = new File( myClasspathEntry ).toURL();
}
catch ( MalformedURLException e )
{
throw new ExpressionDocumentationException(
"Cannot construct expression documentation classpath resource base.",
e );
}
return new URLClassLoader( new URL[] { docResource } );
}
}