inlink e.g. from a mail sent ..
@param exchange
174917
public void handleDirectRequest(HttpServerExchange exchange) {
        Log.Info(this,"direct link path:"+exchange.getRelativePath());
        exchange.setResponseCode(200);
        exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/html; charset=utf-8");
        exchange.getResponseSender().send( "Hello there, "+exchange.getRequestPath() );
    }
1198395
public void extractJson(Exchange exchange)
    {
        InputStreamCache iscache = exchange.getIn().getBody(InputStreamCache.class);

        String postStr = null;

        try
        {
            postStr = IOUtils.toString(iscache);
            postStr = URLDecoder.decode(postStr, "utf-8");
        }
        catch (IOException ioex)
        {
            logger.warn("Failed to extract string from Request. Dispose request.", ioex);
            return;
        }

        int firstSeparatorIndex = postStr.indexOf(KEYVALUE_SEPARATOR);
        if (firstSeparatorIndex == -1)
        {
            String logFormat = "Received request is invalid. Dispose request. : Request={0}";
            String logMessage = MessageFormat.format(logFormat, postStr);
            logger.warn(logMessage);
            return;
        }

        String jsonStr = postStr.substring(firstSeparatorIndex + 1);

        if (this.isDoValidate == false)
        {
            exchange.getOut().setBody(jsonStr);
            return;
        }

        JSONObject jsonObj = null;

        try
        {
            jsonObj = JSONObject.fromObject(jsonStr);
        }
        catch (JSONException jsonex)
        {
            logger.warn("Received request is invalid. Dispose request.", jsonex);
            return;
        }

        exchange.getOut().setBody(jsonObj.toString());
    }
1027279
static void processOK(HttpServerExchange exchange) throws IOException {
        exchange.setStatusCode(StatusCodes.OK);
        exchange.getResponseHeaders().add(Headers.CONTENT_TYPE, CONTENT_TYPE);
        exchange.endExchange();
    }
1130180
public List<BindingInfo> getBindingsBySource(String vhost, String exchange) {
    final String x = exchange.equals("") ? "amq.default" : exchange;
    final URI uri = uriWithPath("./exchanges/" + encodePathSegment(vhost) +
        "/" + encodePathSegment(x) + "/bindings/source");
    return Arrays.asList(this.rt.getForObject(uri, BindingInfo[].class));
  }
453359
public void setLinked(boolean linked) {
        if (linked != this.linked) {
            this.linked = linked;
            
            if (!initializing) {
                internalDeserialize(true);
                getRoot().activate(true);
            }
        }
    }
1055392
private void updateLinkedClient(Account account, MultivaluedMap<String, String> data) {
        logger.debug("checking linked client");
        String email = account.getEmailAddress();
        if (email != null && !email.equals("")) {
            logger.debug("account email is valid");
            String username = email.split("@")[0];
            Client client = clientDao.getClient(username, account.getOrganizationSid());
            if (client != null) {
                logger.debug("client found");
                // TODO: need to encrypt this password because it's
                // same with Account password.
                // Don't implement now. Opened another issue for it.
                if (data.containsKey("Password")) {
                    // Md5Hash(data.getFirst("Password")).toString();
                    logger.debug("password changed");
                    String password = data.getFirst("Password");
                    client = client.setPassword(client.getLogin(), password, organizationsDao.getOrganization(account.getOrganizationSid()).getDomainName());
                }

                if (data.containsKey("FriendlyName")) {
                    logger.debug("friendlyname changed");
                    client = client.setFriendlyName(data.getFirst("FriendlyName"));
                }
                logger.debug("updating linked client");
                clientDao.updateClient(client);
            }
        }
    }
153769
@Override
    public void handleRequest(final HttpServerExchange exchange) throws Exception {

        // handle request header
        Map<String, Object> requestHeaderMap = (Map<String, Object>)config.get(REQUEST);
        if(requestHeaderMap != null) {
            List<String> requestHeaderRemove = (List<String>)requestHeaderMap.get(REMOVE);
            if(requestHeaderRemove != null) {
                requestHeaderRemove.forEach(s -> exchange.getRequestHeaders().remove(s));
            }
            Map<String, String> requestHeaderUpdate = (Map<String, String>)requestHeaderMap.get(UPDATE);
            if(requestHeaderUpdate != null) {
                requestHeaderUpdate.forEach((k, v) -> exchange.getRequestHeaders().put(new HttpString(k), v));
            }
        }

        // handle response header
        Map<String, Object> responseHeaderMap = (Map<String, Object>)config.get(RESPONSE);
        if(responseHeaderMap != null) {
            List<String> responseHeaderRemove = (List<String>)responseHeaderMap.get(REMOVE);
            if(responseHeaderRemove != null) {
                responseHeaderRemove.forEach(s -> exchange.getResponseHeaders().remove(s));
            }
            Map<String, String> responseHeaderUpdate = (Map<String, String>)responseHeaderMap.get(UPDATE);
            if(responseHeaderUpdate != null) {
                responseHeaderUpdate.forEach((k, v) -> exchange.getResponseHeaders().put(new HttpString(k), v));
            }
        }
        Handler.next(exchange, next);
    }
784550
function onLinkWithEmailLink() {
  var email = $('#link-with-email-link-email').val();
  var link = $('#link-with-email-link-link').val() || undefined;
  var credential = firebase.auth.EmailAuthProvider
      .credentialWithLink(email, link);
  activeUser().linkWithCredential(credential)
      .then(onAuthUserCredentialSuccess, onAuthError);
}
628810
public final static void appendMailto(final StringBuilder out, final String in, final int start, final int end)
    {
        for (int i = start; i < end; i++)
        {
            final char c;
            final int r = rnd();
            switch (c = in.charAt(i))
            {
            case '&':
            case '<':
            case '>':
            case '"':
            case '\'':
            case '@':
                if (r < 512)
                {
                    appendDecEntity(out, c);
                }
                else
                {
                    appendHexEntity(out, c);
                }
                break;
            default:
                if (r < 32)
                {
                    out.append(c);
                }
                else if (r < 520)
                {
                    appendDecEntity(out, c);
                }
                else
                {
                    appendHexEntity(out, c);
                }
                break;
            }
        }
    }
213874
public void dump(Exchange exchange) throws IOException
    {
        if (logger.isDebugEnabled())
        {
            logger.debug(ToStringBuilder.reflectionToString(exchange.getIn().getBody(),
                    ToStringStyle.SHORT_PREFIX_STYLE));
        }
    }
384309
protected Message invokeEndpointAdapter(MailMessage mail) {
        if (splitMultipart) {
            return split(mail.getPayload(MailRequest.class).getBody(), mail.getHeaders());
        } else {
            return getEndpointAdapter().handleMessage(mail);
        }
    }
339502
public void setEmail(String email) {
        SystemAssert.requireArgument(email != null && !email.isEmpty(), "Email cannot be null or empty.");
        this.email = email;
    }
460134
public void exchangeDone() {
        log.debugf("exchange complete in connection to %s", getPeerAddress());

        connection.getSinkChannel().setConduit(originalSinkConduit);
        connection.getSourceChannel().setConduit(pushBackStreamSourceConduit);
        connection.getSinkChannel().suspendWrites();
        connection.getSinkChannel().setWriteListener(null);

        if (anyAreSet(state, CLOSE_REQ)) {
            currentRequest = null;
            pendingResponse = null;
            this.state |= CLOSED;
            safeClose(connection);
        } else if (anyAreSet(state, UPGRADE_REQUESTED)) {
            connection.getSourceChannel().suspendReads();
            currentRequest = null;
            pendingResponse = null;
            return;
        }
        currentRequest = null;
        pendingResponse = null;

        HttpClientExchange next = pendingQueue.poll();
        if (next == null) {
            //we resume reads, so if the target goes away we get notified
            connection.getSourceChannel().setReadListener(clientReadListener);
            connection.getSourceChannel().resumeReads();
        } else {
            initiateRequest(next);
        }
    }
12683
def parse_email_for_explicit_link(email, regex)
      regex = /#{Regexp.escape(regex)}/ unless regex.is_a?(Regexp)
      links_in_email(email).detect { |link| link =~ regex }
    end
598903
static void sendResponse(final HttpServerExchange exchange, final String response) {
        exchange.setStatusCode(StatusCodes.OK);
        exchange.getResponseHeaders().add(Headers.CONTENT_TYPE, CONTENT_TYPE);
        final Sender sender = exchange.getResponseSender();
        UndertowLogger.ROOT_LOGGER.mcmpSendingResponse(exchange.getSourceAddress(), exchange.getStatusCode(), exchange.getResponseHeaders(), response);
        sender.send(response);
    }
647598
@NonNull
    protected Intent buildAttachmentIntent(@NonNull String subject, @Nullable String body, @NonNull ArrayList<Uri> attachments) {
        final Intent intent = new Intent(Intent.ACTION_SEND_MULTIPLE);
        intent.putExtra(Intent.EXTRA_EMAIL, new String[]{mailConfig.mailTo()});
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtra(Intent.EXTRA_SUBJECT, subject);
        intent.setType("message/rfc822");
        intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, attachments);
        intent.putExtra(Intent.EXTRA_TEXT, body);
        return intent;
    }
594908
@Override
    public void handleRequest(HttpServerExchange exchange) throws Exception {
        if ( exchange.getRequestMethod() != Methods.POST ) {
            exchange.setResponseCode(404);
            exchange.endExchange();
            return;
        }
        String rpath = exchange.getRelativePath();

        StreamSourceChannel requestChannel = exchange.getRequestChannel();
        String first = exchange.getRequestHeaders().getFirst(Headers.CONTENT_LENGTH);
        int len = Integer.parseInt(first);

        // read post data.
        ByteBuffer buf = ByteBuffer.allocate(len);
        requestChannel.getReadSetter().set( streamSourceChannel -> {
                try {
                    streamSourceChannel.read(buf);
                } catch (IOException e) {
                    Log.Warn(this,e);
                }
                if ( buf.remaining() == 0 ) {
                    try {
                        requestChannel.shutdownReads();
                    } catch (IOException e) {
                        Log.Warn(this,e);
                    }
                    facade.execute( () -> requestReceived( exchange, buf.array(), rpath ) );
                }
            }
        );
        requestChannel.resumeReads();
    }