Hi,
I had my own IResourceStreamLocator in my settings class. And in my class i still uses the ClassLoaderREsourceLocator and my own.
But suddenly i see that the paths i get are this "signinhtml" instead of "
signin.html"
So the dot is suddenly gone if i don't use the DefaultResourceStreamLocator because in a base class the ResourceStreamLocator
does a check if the extention starts with . ...
Now i find that ResourceStreamLocator a very strange class..
just this piece:
public class ResourceStreamLocator implements IResourceStreamLocator
{
/** The resource locator */
private IResourceStreamLocator locator;
Why implement a IResourceStreamLocator and then again have one inside it.. What do you do then?
Does anybody object or see problems when i do this
Move this code to of ResourceStreamLocator to AbstractResourceStreamLocator
final String extensionString;
if (extension == null)
{
extensionString = "." + Strings.lastPathComponent(path, '.');
path = Strings.beforeLastPathComponent(path, '.');
}
else
{
if (
extension.startsWith("."))
{
extensionString = extension;
}
else
{
extensionString = "." + extension;
}
}
So that all that extend that one are always sure that the path is right (they don't depend anymore on a call through a completely other class)
Then i want to get rid of ResourceStreamLocator and DefaultResourceStreamLocator
And make a CompoundResourceStreamLocator that does what defaultresoucestream locator does now, cycle through the list and try to load.
?
Then it is not so confusing anymore and everything doesn't depend on other things..
johan
- [Wicket-develop] some more refactorings of IResourceStr... Johan Compagner
- Re: [Wicket-develop] some more refactorings of IRe... Juergen Donnerstag