THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
public class PathStripperLocator extends ResourceStreamLocator { public PathStripperLocator() { } 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); } } |
or perhaps:
Code Block |
---|
...
private String trimFolders(String path) {
if (path.startsWith("org/apache/wicket") && !path.matches("org/apache/wicket/Application.*properties")) {
return path;
}
return path.substring(path.lastIndexOf("/") + 1);
}
...
|
Secondly, override Application.init() method to add the new IResourceStreamLocator:
...