本文整理匯總了Java中org.apache.http.HttpHeaders.AUTHORIZATION屬性的典型用法代碼示例。如果您正苦於以下問題:Java HttpHeaders.AUTHORIZATION屬性的具體用法?Java HttpHeaders.AUTHORIZATION怎麽用?Java HttpHeaders.AUTHORIZATION使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.apache.http.HttpHeaders
的用法示例。
在下文中一共展示了HttpHeaders.AUTHORIZATION屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doSendRequest
@Override
protected HttpResponse doSendRequest(final HttpRequest request, final HttpClientConnection conn, final HttpContext context) throws IOException, HttpException {
synchronized(listener) {
listener.log(TranscriptListener.Type.request, request.getRequestLine().toString());
for(Header header : request.getAllHeaders()) {
switch(header.getName()) {
case HttpHeaders.AUTHORIZATION:
case "X-Auth-Key":
case "X-Auth-Token":
listener.log(TranscriptListener.Type.request, String.format("%s: %s", header.getName(),
StringUtils.repeat("*", Integer.min(8, StringUtils.length(header.getValue())))));
break;
default:
listener.log(TranscriptListener.Type.request, header.toString());
break;
}
}
}
return super.doSendRequest(request, conn, context);
}
示例2: facade
/**
* @param cookieAuthValue クッキー內の p_cookieキーに指定された値
* @param cookiePeer p_cookie_peerクエリに指定された値
* @param authzHeaderValue Authorization ヘッダ
* @param host Host ヘッダ
* @param uriInfo UriInfo
* @param xPersoniumUnitUser X-Personium-UnitUserヘッダ
* @param httpServletRequest HttpServletRequest
* @return CellResourceオブジェクトまたはResponseオブジェクト
*/
@Path("{path1}")
public final Object facade(
@CookieParam(P_COOKIE_KEY) final String cookieAuthValue,
@QueryParam(COOKIE_PEER_QUERY_KEY) final String cookiePeer,
@HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue,
@HeaderParam(HttpHeaders.HOST) final String host,
@HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser,
@Context final UriInfo uriInfo,
@Context HttpServletRequest httpServletRequest) {
Cell cell = ModelFactory.cell(uriInfo);
AccessContext ac = AccessContext.create(authzHeaderValue,
uriInfo, cookiePeer, cookieAuthValue, cell, uriInfo.getBaseUri().toString(),
host, xPersoniumUnitUser);
if (cell == null) {
throw PersoniumCoreException.Dav.CELL_NOT_FOUND;
}
CellLockManager.STATUS cellStatus = CellLockManager.getCellStatus(cell.getId());
if (CellLockManager.STATUS.BULK_DELETION.equals(cellStatus)) {
throw PersoniumCoreException.Dav.CELL_NOT_FOUND;
}
CellLockManager.incrementReferenceCount(cell.getId());
httpServletRequest.setAttribute("cellId", cell.getId());
return new CellResource(ac, httpServletRequest);
}
示例3: ctl
/**
* @param cookieAuthValue クッキー內の p_cookieキーに指定された値
* @param cookiePeer p_cookie_peerクエリに指定された値
* @param authzHeaderValue Authorization ヘッダ
* @param host Host ヘッダ
* @param xPersoniumUnitUser ヘッダ
* @param uriInfo UriInfo
* @return UnitCtlResourceオブジェクト
*/
@Path("__ctl")
public final UnitCtlResource ctl(
@CookieParam(P_COOKIE_KEY) final String cookieAuthValue,
@QueryParam(COOKIE_PEER_QUERY_KEY) final String cookiePeer,
@HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue,
@HeaderParam(HttpHeaders.HOST) final String host,
@HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser,
@Context final UriInfo uriInfo) {
AccessContext ac = AccessContext.create(authzHeaderValue,
uriInfo, cookiePeer, cookieAuthValue, null, uriInfo.getBaseUri().toString(),
host, xPersoniumUnitUser);
return new UnitCtlResource(ac, uriInfo);
}
示例4: status
/**
* @param authzHeaderValue Authorization ヘッダ
* @param host Host ヘッダ
* @param xPersoniumUnitUser ヘッダ
* @param uriInfo UriInfo
* @return UnitCtlResourceオブジェクト
*/
@Path("__status")
public final StatusResource status(
@HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue,
@HeaderParam(HttpHeaders.HOST) final String host,
@HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser,
@Context final UriInfo uriInfo) {
return new StatusResource();
}
示例5: getBasicAuthorizationHeader
private static Header getBasicAuthorizationHeader(String user, String password) {
return new BasicHeader(HttpHeaders.AUTHORIZATION,
AUTHORIZATION_BASIC + " " + OpenApisEndpoint.encodeBase64(user, password));
}
示例6: SAPIClient
public SAPIClient(Map<String, String> op) throws MalformedURLException {
this(op.get("api.status.link"), "", "");
auth = new BasicHeader(HttpHeaders.AUTHORIZATION,
op.get("api.status.auth").replaceAll(",$", ""));
}
示例7: getBasicAuthorizationHeader
private Header getBasicAuthorizationHeader(String user, String password) {
return new BasicHeader(HttpHeaders.AUTHORIZATION,
AUTHORIZATION_BASIC + " " + OpenApisEndpoint.encodeBase64(user, password));
}
開發者ID:SAP,項目名稱:cloud-ariba-discovery-rfx-to-external-marketplace-ext,代碼行數:4,代碼來源:OpenApisEndpoint.java