[Yanel-dev] String.replaceAll problem

Michael Wechner michael.wechner at wyona.com
Fri Dec 7 17:21:39 CET 2007


Evaldas Taroza wrote:

> Hi,
> I am on Windows and I get many many errors logged when I open Yanel 
> web page. Most of them are generated in YanelServlet 1979 line and 
> what matters is:
>
> htdocsPath = "yanel-htdocs" + path.split("::" + name)[1].split("/" + 
> reservedPrefix)[1].replaceAll("/", File.separator);
>
> I debugged that line and it appears that replaceAll("/", 
> File.separator) causes problems.
>
> In windows the path separator is "\" which on the above replacement 
> causes StringIndexOutOfBoundsException. What actually works is
>
> replaceAll("/", "\\\\")
>
> and I am not sure how to solve it. Maybe the replacement is not needed 
> at all?


I guess that's the only solution not to use it

> Or the bug is in the regular java expressions?


I guess so. What about replacing it with split and then concat again?

Cheers

Michi

>
> Evaldas
> _______________________________________________
> Yanel-development mailing list
> Yanel-development at wyona.com
> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development



-- 
Michael Wechner
Wyona      -   Open Source Content Management - Yanel, Yulup
http://www.wyona.com
michael.wechner at wyona.com, michi at apache.org
+41 44 272 91 61



More information about the Yanel-development mailing list