本文整理匯總了Java中javax.ws.rs.core.MultivaluedMap.remove方法的典型用法代碼示例。如果您正苦於以下問題:Java MultivaluedMap.remove方法的具體用法?Java MultivaluedMap.remove怎麽用?Java MultivaluedMap.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.ws.rs.core.MultivaluedMap
的用法示例。
在下文中一共展示了MultivaluedMap.remove方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testIsRequestValidParamMissing
import javax.ws.rs.core.MultivaluedMap; //導入方法依賴的package包/類
@Test
public void testIsRequestValidParamMissing() {
MultivaluedMap<String,String> params1 = getValidRequestMap();
params1.remove("ckey");
assertFalse(service.isRequestValid(params1));
MultivaluedMap<String,String> params2 = getValidRequestMap();
params2.remove("lang");
assertFalse(service.isRequestValid(params2));
MultivaluedMap<String,String> params3 = getValidRequestMap();
params3.remove("declRef");
assertFalse(service.isRequestValid(params3));
MultivaluedMap<String,String> params4 = getValidRequestMap();
params4.remove("declRef");
assertFalse(service.isRequestValid(params4));
}
開發者ID:vrk-kpa,項目名稱:e-identification-tupas-idp-public,代碼行數:19,代碼來源:RequestVerificationServiceTest.java
示例2: addResponseHeaders
import javax.ws.rs.core.MultivaluedMap; //導入方法依賴的package包/類
/**
* 全てのレスポンスに共通するレスポンスヘッダーを追加する.
* Access-Control-Allow-Origin, Access-Control-Allow-Headers<br/>
* X-Personium-Version<br/>
* @param request
* @param response
*/
private void addResponseHeaders(final ContainerRequest request, final ContainerResponse response) {
MultivaluedMap<String, Object> mm = response.getHttpHeaders();
String acrh = request.getHeaderValue(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS);
if (acrh != null) {
mm.putSingle(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, acrh);
} else {
mm.remove(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS);
}
mm.putSingle(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, HttpHeaders.Value.ASTERISK);
// X-Personium-Version
mm.putSingle(HttpHeaders.X_PERSONIUM_VERSION, PersoniumUnitConfig.getCoreVersion());
}
示例3: getHeaders
import javax.ws.rs.core.MultivaluedMap; //導入方法依賴的package包/類
private Header[] getHeaders(MultivaluedMap<String, String> headers) {
if (headers == null || headers.isEmpty()) {
return new Header[0];
}
int i = 0;
headers.remove(CONTENT_LENGTH);
Header[] headerz = new Header[headers.size()];
for (String key : headers.keySet()) {
headerz[i] = new BasicHeader(key, headers.getFirst(key));
i++;
}
return headerz;
}
示例4: filter
import javax.ws.rs.core.MultivaluedMap; //導入方法依賴的package包/類
@Override
public void filter(
ContainerRequestContext containerRequestContext,
ContainerResponseContext containerResponseContext)
throws IOException {
Object entity = containerResponseContext.getEntity();
if (entity instanceof Try.Failure) {
Try.Failure failure = (Try.Failure)entity;
Exception exception = failure.getException();
Optional<APIError> optional = _exceptionConverterManager.convert(
exception);
APIError apiError = optional.orElseThrow(
() -> new MustHaveExceptionConverter(exception.getClass()));
if (_apioLogger != null) {
_apioLogger.error(apiError);
}
ErrorMessageMapper errorMessageMapper =
_errorMessageMapperManager.getErrorMessageMapper(
apiError, _httpHeaders);
String result = ErrorWriter.writeError(
errorMessageMapper, apiError, _httpHeaders);
MultivaluedMap<String, Object> headers =
containerResponseContext.getHeaders();
headers.remove("Content-Type");
headers.add("Content-Type", errorMessageMapper.getMediaType());
containerResponseContext.setEntity(result);
containerResponseContext.setStatus(apiError.getStatusCode());
}
}
示例5: popQueryParamValue
import javax.ws.rs.core.MultivaluedMap; //導入方法依賴的package包/類
public static String popQueryParamValue(String parameter, MultivaluedMap<String, String> queryParameters) {
List<String> values = queryParameters.remove(parameter);
if (values != null && values.iterator().hasNext()) {
return values.iterator().next();
}
return null;
}