public static UrlParserResult parse(String pathInfo)
			throws NotFoundException {
		UrlParserResult result = new UrlParserResult();

		if (pathInfo == null) {
			throw new NotFoundException(pathInfo);
		} else if ("/catalog".equals(pathInfo)) {
			result.setResourceType(ResourceType.Catalog);
		} else {
			String[] splits = pathInfo.split("/");
			if (splits.length == 3) {
				if ("service_instances".equals(splits[1])
						&& "".equals(splits[0])) {
					result.setResourceType(ResourceType.Instance);
					result.setInstanceId(splits[2]);
				} else {
					throw new NotFoundException(pathInfo);
				}
			} else if (splits.length == 5) {
				if ("service_instances".equals(splits[1])
						&& "service_bindings".equals(splits[3])
						&& "".equals(splits[0])) {
					result.setResourceType(ResourceType.Binding);
					result.setInstanceId(splits[2]);
					result.setBindingId(splits[4]);
				} else {
					throw new NotFoundException(pathInfo);
				}
			} else {
				throw new NotFoundException(pathInfo);
			}
		}

		return result;
	}