/*
 * $Id$
 * $Revision$
 * $Date$
 * 
 * ==============================================================================
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package wicket.util.file;

import java.net.URL;

/**
 * Path for working with OSGi bundles.
 *
 * @author Timur Mehrvarz
 */
public final class OsgiPath implements IResourceFinder
{
	/**
	 * Constructor.
	 */
	public OsgiPath()
	{
	}

	/**
	 * Looks for a given file along this path in a OSGI bundle.
	 * @param pathname The filename with possible path
	 * @return The url located on the path
	 */
	public URL find(final String pathname)
	{
		return getClass().getResource("/" + pathname);
	}
}

@@ -861,52 +861,268 @@
 %09/**
-%0A%09 * Constructor.%0A%09 */%0A%09public OsgiPath()%0A%09%7B
+ class loader to be used for locating resources. */%0A%09final ClassLoader classLoader;%0A%0A%09/**%0A%09 * Constructor.%0A%09 * @param classLoader class loader to be used for locating resources%0A%09 */%0A%09public OsgiPath(ClassLoader classLoader)%0A%09%7B%0A%09%09this.classLoader = classLoader;
 %0A%09%7D%0A
@@ -1149,19 +1149,23 @@
 a given 
-fil
+pathnam
 e along 
@@ -1181,14 +1181,23 @@
  in 
-a
+the
  OSG
-I
+i (jar) 
  bun
@@ -1201,16 +1201,20 @@
 bundle.%0A
+%09 *%0A
 %09 * @par
@@ -1224,16 +1224,31 @@
 pathname
+%0A%09 *           
  The fil
@@ -1366,25 +1366,70 @@
 %7B%0A%09%09
-return getClass()
+String resourcePathName = %22/%22 + pathname;%0A%09%09return classLoader
 .get
@@ -1437,27 +1437,29 @@
 esource(
-%22/%22 + pathn
+resourcePathN
 ame);%0A%09%7D

classloader has to be provided