> +/**
> + * Encodes "." as %2e when getting a user with restricted hostname
> + *
> + * @author Zack Shoylev
> + *
> + */
> +@Singleton
> +public class EncodeDotsForUserGet implements HttpRequestFilter {
> +
> + @Override
> + public HttpRequest filter(HttpRequest request) throws HttpException {
> + String endpoint = request.getEndpoint().toString();
> + Pattern pattern = Pattern.compile("/[^/]*$"); // From last / to the
> end of the line
> + Matcher matcher = pattern.matcher(endpoint);
> + matcher.find();
> + String encodable = matcher.group();
What if nothing is found? Or is the assumption that that cannot happen? If so,
add a comment to that effect?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/14/files#r5096005