public static List<PathSegment> getPathSegments(String thePath, boolean decode) {
String[] segments = thePath.split("/");
List<PathSegment> theList = new ArrayList<PathSegment>();
for (String path : segments) {
if (!StringUtils.isEmpty(path)) {
theList.add(new PathSegmentImpl(path, decode));
}
}
return theList;
}