private static String parseVersionId(String query) {
        if (query != null) {
            String[] params = VERSION_ID_PATTERN.split(query);
            for (String param : params) {
                if (param.startsWith("versionId=")) {
                    return decode(param.substring(10));
                }
            }
        }
        return null;
    }
Attempts to parse a versionId parameter from the query
string.

@param query the query string to parse (possibly null)
@return the versionId (possibly null)
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3URI.java