public static User getUser(Uri uri) {
        List<String> segments = uri.getPathSegments();
        if (segments.size() < 1) {
            return null;
        }

        String login = segments.get(0);
        if (!RepositoryUtils.isValidOwner(login)) {
            return null;
        }


        return User.builder()
                .login(login)
                .build();
    }
Attempt to parse a {@link User} from the given {@link Uri}

@param uri
@return {@link User} or null if unparseable
app/src/main/java/com/github/pockethub/android/core/user/UserUriMatcher.java