rest-model/src/main/java/org/jboss/pnc/rest/validation/validators/ScmUrlValidator.java
private static String getUsername(String url) {
        int atIndex = url.lastIndexOf(USERNAME_INDICATOR);
        if (atIndex < 0) {
            return null;
        }
        String username = url.substring(0, atIndex + 1);
        int slashIndex = username.lastIndexOf('/');
        if (slashIndex > 0) {
            username = username.substring(slashIndex + 1);
        }
        return username;
    }
private static String getUsername(String url) {
        int atIndex = url.lastIndexOf(USERNAME_INDICATOR);
        if (atIndex < 0) {
            return null;
        }
        String username = url.substring(0, atIndex + 1);
        int slashIndex = username.lastIndexOf('/');
        if (slashIndex > 0) {
            username = username.substring(slashIndex + 1);
        }
        return username;
    }
Returns a String with username.
'@' character or whatever indicator of it being username is included in the returned value

@param url url to extract username from
@return username if username is specified in the url, null otherwise