class AuthorizationHeaders {

    public static String[] decode( String authorizationHeader )
    {
        String[] parts = authorizationHeader.trim().split( " " );
        String tokenSegment = parts[parts.length - 1];

        if ( tokenSegment.trim().length() == 0 )
        {
            return null;
        }

        String decoded = Base64.base64Decode( tokenSegment );
        if ( decoded.length() < 1 )
        {
            return null;
        }

        String[] userAndPassword = decoded.split( ":", 2 );
        if ( userAndPassword.length != 2 )
        {
            return null;
        }

        return userAndPassword;
    }

    private  AuthorizationHeaders();

}