Improve StringUtils.cleanPath

Issue: SPR-11793