org.apache.cxf.jaxrs.utils.JAXRSUtils Java Examples
The following examples show how to use
org.apache.cxf.jaxrs.utils.JAXRSUtils.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WadlGenerator.java From cxf with Apache License 2.0 | 6 votes |
@Override public QName resolve(Class<?> type, Annotation[] annotations, Map<Class<?>, QName> clsMap) { QName qname = WadlGenerator.this.getJaxbQName(proxy, type, clsMap); if (qname == null && supportJaxbXmlType) { XmlType root = type.getAnnotation(XmlType.class); if (root != null) { XMLName name = AnnotationUtils.getAnnotation(annotations, XMLName.class); if (name == null) { qname = getJaxbQName(root.name(), root.namespace(), type, clsMap); } else { QName tempQName = JAXRSUtils.convertStringToQName(name.value()); qname = new QName(tempQName.getNamespaceURI(), tempQName.getLocalPart(), getPrefix(tempQName.getNamespaceURI(), clsMap)); } } } return qname; }
Example #2
Source File: ProviderFactory.java From cxf with Apache License 2.0 | 6 votes |
public int compare(ProviderInfo<MessageBodyWriter<?>> p1, ProviderInfo<MessageBodyWriter<?>> p2) { MessageBodyWriter<?> e1 = p1.getProvider(); MessageBodyWriter<?> e2 = p2.getProvider(); int result = compareClasses(e1, e2); if (result != 0) { return result; } List<MediaType> types1 = JAXRSUtils.sortMediaTypes(JAXRSUtils.getProviderProduceTypes(e1), JAXRSUtils.MEDIA_TYPE_QS_PARAM); List<MediaType> types2 = JAXRSUtils.sortMediaTypes(JAXRSUtils.getProviderProduceTypes(e2), JAXRSUtils.MEDIA_TYPE_QS_PARAM); result = JAXRSUtils.compareSortedMediaTypes(types1, types2, JAXRSUtils.MEDIA_TYPE_QS_PARAM); if (result != 0) { return result; } result = compareCustomStatus(p1, p2); if (result != 0) { return result; } return comparePriorityStatus(p1.getProvider().getClass(), p2.getProvider().getClass()); }
Example #3
Source File: JAXRSOutInterceptor.java From cxf with Apache License 2.0 | 6 votes |
private void handleWriteException(ServerProviderFactory pf, Message message, Throwable ex, boolean firstTry) { Response excResponse = null; if (firstTry) { excResponse = JAXRSUtils.convertFaultToResponse(ex, message); } else { message.getExchange().put(JAXRSUtils.SECOND_JAXRS_EXCEPTION, Boolean.TRUE); } if (excResponse == null) { setResponseStatus(message, 500); throw new Fault(ex); } serializeMessage(pf, message, excResponse, null, false); }
Example #4
Source File: JAXRSServiceImpl.java From cxf with Apache License 2.0 | 6 votes |
private void createMessagePartInfo(OperationInfo oi, Class<?> type, QName qname, Method m, boolean input) { if (type == void.class || Source.class.isAssignableFrom(type)) { return; } if (InjectionUtils.isPrimitive(type) || Response.class == type) { return; } QName mName = new QName(qname.getNamespaceURI(), (input ? "in" : "out") + m.getName()); MessageInfo ms = oi.createMessage(mName, input ? MessageInfo.Type.INPUT : MessageInfo.Type.OUTPUT); if (input) { oi.setInput("in", ms); } else { oi.setOutput("out", ms); } QName mpQName = JAXRSUtils.getClassQName(type); MessagePartInfo mpi = ms.addMessagePart(mpQName); mpi.setConcreteName(mpQName); mpi.setTypeQName(mpQName); mpi.setTypeClass(type); }
Example #5
Source File: ClientResponseFilterInterceptor.java From cxf with Apache License 2.0 | 6 votes |
protected Response getResponse(Message inMessage) { Response resp = inMessage.getExchange().get(Response.class); if (resp != null) { return JAXRSUtils.copyResponseIfNeeded(resp); } ResponseBuilder rb = JAXRSUtils.toResponseBuilder((Integer)inMessage.get(Message.RESPONSE_CODE)); rb.entity(inMessage.get(InputStream.class)); @SuppressWarnings("unchecked") Map<String, List<String>> protocolHeaders = (Map<String, List<String>>)inMessage.get(Message.PROTOCOL_HEADERS); for (Map.Entry<String, List<String>> entry : protocolHeaders.entrySet()) { if (null == entry.getKey()) { continue; } if (entry.getValue().size() > 0) { for (String val : entry.getValue()) { rb.header(entry.getKey(), val); } } } return rb.build(); }
Example #6
Source File: AbstractJAXBProvider.java From cxf with Apache License 2.0 | 6 votes |
@SuppressWarnings({ "unchecked", "rawtypes" }) protected Object convertToJaxbElementIfNeeded(Object obj, Class<?> cls, Type genericType) throws Exception { Class<?> jaxbElementCls = jaxbElementClassNames == null ? null : getJaxbElementClass(cls); boolean asJaxbElement = jaxbElementCls != null; if (!asJaxbElement && isXmlRoot(cls) && !xmlRootAsJaxbElement) { return obj; } if (jaxbElementCls == null) { jaxbElementCls = cls; } QName name = null; String expandedName = jaxbElementClassMap.get(jaxbElementCls.getName()); if (expandedName != null) { name = JAXRSUtils.convertStringToQName(expandedName); } else if (marshalAsJaxbElement || asJaxbElement) { name = getJaxbQName(jaxbElementCls, genericType, obj, false); } return name != null ? new JAXBElement<Object>(name, (Class)jaxbElementCls, null, obj) : obj; }
Example #7
Source File: MultipartProvider.java From cxf with Apache License 2.0 | 6 votes |
private <T> DataHandler getHandlerForObject(T obj, Class<T> cls, Type genericType, Annotation[] anns, String mimeType) { MediaType mt = JAXRSUtils.toMediaType(mimeType); mc.put(ProviderFactory.ACTIVE_JAXRS_PROVIDER_KEY, this); MessageBodyWriter<T> r = null; try { r = mc.getProviders().getMessageBodyWriter(cls, genericType, anns, mt); } finally { mc.put(ProviderFactory.ACTIVE_JAXRS_PROVIDER_KEY, null); } if (r == null) { org.apache.cxf.common.i18n.Message message = new org.apache.cxf.common.i18n.Message("NO_MSG_WRITER", BUNDLE, cls); LOG.severe(message.toString()); throw ExceptionUtils.toInternalServerErrorException(null, null); } return new MessageBodyWriterDataHandler<T>(r, obj, cls, genericType, anns, mt); }
Example #8
Source File: AuthorizationUtils.java From cxf with Apache License 2.0 | 6 votes |
public static void throwAuthorizationFailure(Set<String> challenges, String realm, Throwable cause) { ResponseBuilder rb = JAXRSUtils.toResponseBuilder(401); StringBuilder sb = new StringBuilder(); for (String challenge : challenges) { if ("*".equals(challenge)) { continue; } if (sb.length() > 0) { sb.append(','); } sb.append(challenge); } if (sb.length() > 0) { if (realm != null) { sb.append(" realm=\"").append(realm).append('"'); } rb.header(HttpHeaders.WWW_AUTHENTICATE, sb.toString()); } if (cause != null) { rb.entity(cause.getMessage()); } throw ExceptionUtils.toNotAuthorizedException(cause, rb.build()); }
Example #9
Source File: AbstractSAML2SPServlet.java From syncope with Apache License 2.0 | 6 votes |
protected SAML2ReceivedResponseTO extract( final String spEntityID, final String urlContext, final String clientAddress, final InputStream response) throws IOException { String strForm = IOUtils.toString(response); MultivaluedMap<String, String> params = JAXRSUtils.getStructuredParams(strForm, "&", false, false); String samlResponse = params.getFirst(SSOConstants.SAML_RESPONSE); if (StringUtils.isNotBlank(samlResponse)) { samlResponse = URLDecoder.decode(samlResponse, StandardCharsets.UTF_8); LOG.debug("Received SAML Response: {}", samlResponse); } String relayState = params.getFirst(SSOConstants.RELAY_STATE); LOG.debug("Received Relay State: {}", relayState); SAML2ReceivedResponseTO receivedResponseTO = new SAML2ReceivedResponseTO(); receivedResponseTO.setSpEntityID(spEntityID); receivedResponseTO.setUrlContext(urlContext); receivedResponseTO.setSamlResponse(samlResponse); receivedResponseTO.setRelayState(relayState); return receivedResponseTO; }
Example #10
Source File: BookStore.java From cxf with Apache License 2.0 | 6 votes |
private String getRecipientText(JweJsonConsumer consumer, String recipientPropLoc, String recipientKid) { Message message = JAXRSUtils.getCurrentMessage(); Properties recipientProps = JweUtils.loadJweProperties(message, recipientPropLoc); JsonWebKey recipientKey = JwkUtils.loadJwkSet(message, recipientProps, null).getKey(recipientKid); ContentAlgorithm contentEncryptionAlgorithm = JweUtils.getContentEncryptionAlgorithm(recipientProps); JweDecryptionProvider jweRecipient = JweUtils.createJweDecryptionProvider(recipientKey, contentEncryptionAlgorithm); JweDecryptionOutput jweRecipientOutput = consumer.decryptWith(jweRecipient, Collections.singletonMap("kid", recipientKid)); return jweRecipientOutput.getContentText(); }
Example #11
Source File: WSS4JBasicAuthFilter.java From cxf with Apache License 2.0 | 6 votes |
public void filter(ContainerRequestContext requestContext) throws IOException { if (requestContext.getUriInfo().getPath().contains(WellKnownService.WELL_KNOWN_PATH)) { return; } Message message = JAXRSUtils.getCurrentMessage(); AuthorizationPolicy policy = message.get(AuthorizationPolicy.class); if (policy == null || policy.getUserName() == null || policy.getPassword() == null) { requestContext.abortWith( Response.status(401).header("WWW-Authenticate", "Basic realm=\"IdP\"").build()); return; } try { super.validate(message); } catch (Exception ex) { throw ExceptionUtils.toInternalServerErrorException(ex, null); } }
Example #12
Source File: JAXRSClientServerValidationTest.java From cxf with Apache License 2.0 | 6 votes |
protected void run() { JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); sf.setResourceClasses(BookStoreWithValidation.class); sf.setResourceProvider(BookStoreWithValidation.class, new SingletonResourceProvider(new BookStoreWithValidation())); sf.setProvider(new ValidationExceptionMapper() { @Override public Response toResponse(ValidationException exception) { Response r = super.toResponse(exception); return JAXRSUtils.toResponseBuilder( r.getStatus()).type("application/xml").entity(new Book("Validation", 123L)).build(); } }); sf.setAddress("http://localhost:" + PORT + "/"); BeanValidationInInterceptor in = new JAXRSBeanValidationInInterceptor(); in.setProvider(new BeanValidationProvider(new JAXRSParameterNameProvider())); sf.setInInterceptors(Arrays.< Interceptor< ? extends Message > >asList( in)); sf.setOutInterceptors(Arrays.< Interceptor< ? extends Message > >asList( new JAXRSBeanValidationOutInterceptor())); sf.create(); }
Example #13
Source File: UriBuilderImpl.java From cxf with Apache License 2.0 | 5 votes |
@Override public UriBuilder replaceQuery(String queryValue) throws IllegalArgumentException { if (queryValue != null) { // workaround to do with a conflicting and confusing requirement where spaces // passed as part of replaceQuery are encoded as %20 while those passed as part // of quertyParam are encoded as '+' queryValue = queryValue.replace(" ", "%20"); } query = JAXRSUtils.getStructuredParams(queryValue, "&", false, true); return this; }
Example #14
Source File: SearchContextImpl.java From cxf with Apache License 2.0 | 5 votes |
public String getSearchExpression() { String queryStr = (String)message.get(Message.QUERY_STRING); if (queryStr != null) { if (MessageUtils.getContextualBoolean(message, USE_ALL_QUERY_COMPONENT)) { return queryStr; } boolean encoded = PropertyUtils.isTrue(getKeepEncodedProperty()); MultivaluedMap<String, String> params = JAXRSUtils.getStructuredParams(queryStr, "&", !encoded, false); String customQueryParamName = (String)message.getContextualProperty(CUSTOM_SEARCH_QUERY_PARAM_NAME); if (customQueryParamName != null) { return params.getFirst(customQueryParamName); } if (queryStr.contains(SHORT_SEARCH_QUERY) || queryStr.contains(SEARCH_QUERY)) { if (params.containsKey(SHORT_SEARCH_QUERY)) { return params.getFirst(SHORT_SEARCH_QUERY); } return params.getFirst(SEARCH_QUERY); } else if (MessageUtils.getContextualBoolean(message, USE_PLAIN_QUERY_PARAMETERS)) { return convertPlainQueriesToFiqlExp(params); } } return null; }
Example #15
Source File: OAuthRequestFilter.java From cxf with Apache License 2.0 | 5 votes |
@Override public void filter(ContainerRequestContext context) { try { Message m = JAXRSUtils.getCurrentMessage(); MessageContext mc = new MessageContextImpl(m); OAuthInfo info = handleOAuthRequest(mc.getHttpServletRequest()); setSecurityContext(mc, m, info); } catch (Exception e) { context.abortWith(Response.status(401).header("WWW-Authenticate", "OAuth").build()); } }
Example #16
Source File: ClassResourceInfo.java From cxf with Apache License 2.0 | 5 votes |
public void injectContexts(Object resourceObject, OperationResourceInfo ori, Message inMessage) { final boolean contextsAvailable = contextsAvailable(); final boolean paramsAvailable = paramsAvailable(); if (contextsAvailable || paramsAvailable) { Object realResourceObject = ClassHelper.getRealObject(resourceObject); if (paramsAvailable) { JAXRSUtils.injectParameters(ori, this, realResourceObject, inMessage); } if (contextsAvailable) { InjectionUtils.injectContexts(realResourceObject, this, inMessage); } } }
Example #17
Source File: SelectMethodCandidatesTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void testFindFromAbstractGenericImpl4() throws Exception { JAXRSServiceFactoryBean sf = new JAXRSServiceFactoryBean(); sf.setResourceClasses(GenericEntityImpl4.class); sf.create(); List<ClassResourceInfo> resources = ((JAXRSServiceImpl)sf.getService()).getClassResourceInfos(); String contentTypes = "text/xml"; String acceptContentTypes = "text/xml"; Message m = new MessageImpl(); m.put(Message.CONTENT_TYPE, "text/xml"); Exchange ex = new ExchangeImpl(); ex.setInMessage(m); m.setExchange(ex); Endpoint e = mockEndpoint(); ex.put(Endpoint.class, e); MetadataMap<String, String> values = new MetadataMap<>(); OperationResourceInfo ori = findTargetResourceClass(resources, m, "/books", "POST", values, contentTypes, sortMediaTypes(acceptContentTypes)); assertNotNull(ori); assertEquals("resourceMethod needs to be selected", "postEntity", ori.getMethodToInvoke().getName()); String value = "<Books><Book><name>The Book</name><id>2</id></Book></Books>"; m.setContent(InputStream.class, new ByteArrayInputStream(value.getBytes())); List<Object> params = JAXRSUtils.processParameters(ori, values, m); assertEquals(1, params.size()); List<?> books = (List<?>)params.get(0); assertEquals(1, books.size()); Book book = (Book)books.get(0); assertNotNull(book); assertEquals(2L, book.getId()); assertEquals("The Book", book.getName()); }
Example #18
Source File: UriBuilderImpl.java From cxf with Apache License 2.0 | 5 votes |
private void setUriParts(URI uri) { if (uri == null) { throw new IllegalArgumentException("uri is null"); } String theScheme = uri.getScheme(); if (theScheme != null) { scheme = theScheme; } String rawPath = uri.getRawPath(); if (!uri.isOpaque() && schemeSpecificPart == null && (theScheme != null || rawPath != null)) { port = uri.getPort(); host = uri.getHost(); if (rawPath != null) { setPathAndMatrix(rawPath); } String rawQuery = uri.getRawQuery(); if (rawQuery != null) { query = JAXRSUtils.getStructuredParams(rawQuery, "&", false, true); } userInfo = uri.getUserInfo(); schemeSpecificPart = null; } else { schemeSpecificPart = uri.getSchemeSpecificPart(); } if (scheme != null && host == null && port == -1 && userInfo == null && CollectionUtils.isEmpty(query) && uri.getSchemeSpecificPart() != null && !schemeSpecificPartMatchesUriPath(uri)) { schemeSpecificPart = uri.getSchemeSpecificPart(); } String theFragment = uri.getFragment(); if (theFragment != null) { fragment = theFragment; } }
Example #19
Source File: HttpHeadersImpl.java From cxf with Apache License 2.0 | 5 votes |
public List<MediaType> getAcceptableMediaTypes() { List<String> lValues = headers.get(HttpHeaders.ACCEPT); if (lValues == null || lValues.isEmpty() || lValues.get(0) == null) { return Collections.singletonList(MediaType.WILDCARD_TYPE); } List<MediaType> mediaTypes = new LinkedList<>(); for (String value : lValues) { mediaTypes.addAll(JAXRSUtils.parseMediaTypes(value)); } sortMediaTypesUsingQualityFactor(mediaTypes); return mediaTypes; }
Example #20
Source File: ServerProviderFactory.java From cxf with Apache License 2.0 | 5 votes |
public static void clearThreadLocalProxies(ServerProviderFactory factory, Message message) { factory.clearThreadLocalProxies(); ClassResourceInfo cri = (ClassResourceInfo)message.getExchange().get(JAXRSUtils.ROOT_RESOURCE_CLASS); if (cri != null) { cri.clearThreadLocalProxies(); } }
Example #21
Source File: UriInfoImpl.java From cxf with Apache License 2.0 | 5 votes |
public MultivaluedMap<String, String> getQueryParameters(boolean decode) { MultivaluedMap<String, String> queries = !caseInsensitiveQueries ? new MetadataMap<String, String>() : new MetadataMap<String, String>(false, true); JAXRSUtils.getStructuredParams(queries, (String)message.get(Message.QUERY_STRING), "&", decode, decode, queryValueIsCollection); return queries; }
Example #22
Source File: UriBuilderImplTest.java From cxf with Apache License 2.0 | 5 votes |
private void compareURIs(URI uri1, URI uri2) { assertEquals("Unexpected scheme", uri1.getScheme(), uri2.getScheme()); assertEquals("Unexpected host", uri1.getHost(), uri2.getHost()); assertEquals("Unexpected port", uri1.getPort(), uri2.getPort()); assertEquals("Unexpected path", uri1.getPath(), uri2.getPath()); assertEquals("Unexpected fragment", uri1.getFragment(), uri2.getFragment()); MultivaluedMap<String, String> queries1 = JAXRSUtils.getStructuredParams(uri1.getRawQuery(), "&", false, false); MultivaluedMap<String, String> queries2 = JAXRSUtils.getStructuredParams(uri2.getRawQuery(), "&", false, false); assertEquals("Unexpected queries", queries1, queries2); }
Example #23
Source File: JweJsonContainerRequestFilter.java From cxf with Apache License 2.0 | 5 votes |
@Override public void filter(ContainerRequestContext context) throws IOException { if (isMethodWithNoContent(context.getMethod()) || isCheckEmptyStream() && !context.hasEntity()) { return; } final byte[] encryptedContent = IOUtils.readBytesFromStream(context.getEntityStream()); if (encryptedContent.length == 0) { return; } try { JweDecryptionOutput out = decrypt(encryptedContent); byte[] bytes = out.getContent(); context.setEntityStream(new ByteArrayInputStream(bytes)); context.getHeaders().putSingle("Content-Length", Integer.toString(bytes.length)); String ct = JoseUtils.checkContentType(out.getHeaders().getContentType(), getDefaultMediaType()); if (ct != null) { context.getHeaders().putSingle("Content-Type", ct); } if (super.isValidateHttpHeaders()) { super.validateHttpHeadersIfNeeded(context.getHeaders(), out.getHeaders()); } } catch (JweException ex) { context.abortWith(JAXRSUtils.toResponse(400)); return; } }
Example #24
Source File: JsonpInInterceptor.java From cxf with Apache License 2.0 | 5 votes |
protected String getCallbackValue(Message message) { String theQuery = (String)message.get(Message.QUERY_STRING); String callback = JAXRSUtils.getStructuredParams(theQuery, "&", false, false).getFirst(callbackParam); if (StringUtils.isEmpty(callback)) { String httpAcceptType = (String)message.get(Message.ACCEPT_CONTENT_TYPE); if (mediaType != null && mediaType.equals(httpAcceptType)) { return defaultCallback; } } return callback; }
Example #25
Source File: OidcRpAuthenticationFilter.java From cxf with Apache License 2.0 | 5 votes |
private MultivaluedMap<String, String> toRequestState(ContainerRequestContext rc) { MultivaluedMap<String, String> requestState = new MetadataMap<>(); requestState.putAll(rc.getUriInfo().getQueryParameters(true)); if (MediaType.APPLICATION_FORM_URLENCODED_TYPE.isCompatible(rc.getMediaType())) { String body = FormUtils.readBody(rc.getEntityStream(), StandardCharsets.UTF_8.name()); FormUtils.populateMapFromString(requestState, JAXRSUtils.getCurrentMessage(), body, StandardCharsets.UTF_8.name(), true); rc.setEntityStream(new ByteArrayInputStream(StringUtils.toBytesUTF8(body))); } return requestState; }
Example #26
Source File: OperationResourceInfo.java From cxf with Apache License 2.0 | 5 votes |
private void checkMediaTypes(String consumeMediaTypes, String produceMediaTypes) { if (consumeMediaTypes != null) { consumeMimes = JAXRSUtils.sortMediaTypes(consumeMediaTypes, null); } else { Consumes cm = AnnotationUtils.getMethodAnnotation(annotatedMethod, Consumes.class); if (cm != null) { consumeMimes = JAXRSUtils.sortMediaTypes(JAXRSUtils.getMediaTypes(cm.value()), null); } else if (classResourceInfo != null) { consumeMimes = JAXRSUtils.sortMediaTypes(classResourceInfo.getConsumeMime(), null); } } if (produceMediaTypes != null) { produceMimes = JAXRSUtils.sortMediaTypes(produceMediaTypes, JAXRSUtils.MEDIA_TYPE_QS_PARAM); } else { Produces pm = AnnotationUtils.getMethodAnnotation(annotatedMethod, Produces.class); if (pm != null) { produceMimes = JAXRSUtils.sortMediaTypes(JAXRSUtils.getMediaTypes(pm.value()), JAXRSUtils.MEDIA_TYPE_QS_PARAM); } else if (classResourceInfo != null) { produceMimes = JAXRSUtils.sortMediaTypes(classResourceInfo.getProduceMime(), JAXRSUtils.MEDIA_TYPE_QS_PARAM); } } }
Example #27
Source File: JAXRSInvoker.java From cxf with Apache License 2.0 | 5 votes |
public Object getServiceObject(Exchange exchange) { Object root = exchange.remove(JAXRSUtils.ROOT_INSTANCE); if (root != null) { return root; } OperationResourceInfo ori = exchange.get(OperationResourceInfo.class); ClassResourceInfo cri = ori.getClassResourceInfo(); return cri.getResourceProvider().getInstance(exchange.getInMessage()); }
Example #28
Source File: JAXRSInvoker.java From cxf with Apache License 2.0 | 5 votes |
private ResourceProvider getResourceProvider(Exchange exchange) { Object provider = exchange.remove(JAXRSUtils.ROOT_PROVIDER); if (provider == null) { OperationResourceInfo ori = exchange.get(OperationResourceInfo.class); ClassResourceInfo cri = ori.getClassResourceInfo(); return cri.getResourceProvider(); } return (ResourceProvider)provider; }
Example #29
Source File: JAXRSInvoker.java From cxf with Apache License 2.0 | 5 votes |
private MessageContentsList checkExchangeForResponse(Exchange exchange) { Response r = exchange.get(Response.class); if (r != null) { JAXRSUtils.setMessageContentType(exchange.getInMessage(), r); return new MessageContentsList(r); } return null; }
Example #30
Source File: JsonpJaxrsWriterInterceptor.java From cxf with Apache License 2.0 | 5 votes |
@Override public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException { String callback = getCallbackValue(JAXRSUtils.getCurrentMessage()); if (!StringUtils.isEmpty(callback)) { context.getHeaders().putSingle(Message.CONTENT_TYPE, JAXRSUtils.toMediaType(getMediaType())); context.getOutputStream().write((callback + getPaddingEnd()).getBytes(StandardCharsets.UTF_8)); } context.proceed(); }