Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
public class PathStripperLocator extends ResourceStreamLocator {

    public PathStripperLocator(IResourceFinder finder) {
        super(finder);
    }

    public IResourceStream locate(final Class clazz, final String path) {
        return super.locate(clazz, trimFolders(path));
    }

    private String trimFolders(String path) {
        if (path.startsWith("org/apache/wicket")) {
            return path;
        }
        return path.substring(path.lastIndexOf("/") + 1);
    }
}

...