Resource (String name) { String n = FileUtilRt.toCanonicalPath(name, '/', false); Resource resource = getClassPath().getResource(n); if (resource == null && n.startsWith("/")) { // compatibility with existing code, non-standard classloader behavior resource = getClassPath().getResource(n.substring(1)); } return resource; }