[Yanel-dev] org.wyona.yarep.impl.repo.vfs.VirtualFileSystemRepository#getNode(java.lang.String) question

Cedric Staub cedric.staub at wyona.com
Fri Aug 27 09:06:38 CEST 2010


On Fri, Aug 27, 2010 at 08:57:37AM +0200, Claudio Corrodi wrote:
> So my question here is: Does it make sense to only remove the trailing 
> slash in VirtualFileSystemRepository#getNode if it's not the root node?

I guess that depends on whether the path is used somewhere else in a
diffrent manner. Personally, I would just do something like this:

String path = getPath();
if(path.endsWith("/")) return path + name
else return path + "/" + name

That way there's no need to care about whether or not to strip the
trailing slash either.

Cheers


More information about the Yanel-development mailing list