String fileName;
URLResourceHandler handler = URLResourceHandlersRegistry.getURLResourceHandler(resource.getProtocol());
if (handler instanceof PackageFileURLResourceHandler)
{
PackageFileURLResourceHandler packagehandler = (PackageFileURLResourceHandler)handler;
fileName = packagehandler.getPackageResourceName(resource);
}
else
{
fileName = extractResourceFromClassesDir(resource.toString());