try {
// have to encode + to stop URLDecoder from treating it as a space (it's only synonymous with %20 in query strings)
String s = part.replaceAll("\\+", "%2B");
segment(URLDecoder.decode(s, "UTF8"));
} catch (UnsupportedEncodingException e) {
throw new InternalRatpackError("UTF8 is not available", e);
}
}
hasTrailingSlash = rawPath.substring(rawPath.length() - 1, rawPath.length()).equals("/");
}