URLConnection只支持基本的认证,你用HTTPClient设置吧。
URLConnection conn = realUrl.openConnection();if (authorization != null) {conn.setRequestProperty("Authorization", authorization);}