Examples of CaseInsensitiveMap


Examples of com.adito.boot.CaseInsensitiveMap

        StringBuffer attrName = new StringBuffer();
        char quote = '\0';
        StringBuffer attrVal = new StringBuffer();
        boolean doName = true;
        boolean doVal = false;
        CaseInsensitiveMap a = new CaseInsensitiveMap();
        for (int i = 0; i < attrs.length(); i++) {
            char ch = attrs.charAt(i);
            if (ch == '\'' && quote == '\0') {
                quote = '\'';
            } else if (ch == '"' && quote == '\0') {
                quote = '"';
//            } else if (((doName && (ch == '\r' || ch == '\n')) || (doVal && ( i == attrs.length() - 1 ) ) || (doVal && ch == ' ' && quote == ' ' && attrVal.length() > 0)
//                || (doVal && ch == '\'' && quote == '\'') || (doVal && ch == '\"' && quote == '\"'))) {
              } else if (doVal && ( ch == quote || ( quote == '\0' && ch == ' ' ) || i == ( attrs.length() - 1 ) ) ) {
              if(quote == '\0') {
                attrVal.append(ch);
              }
                quote = '\0';
                String an = attrName.toString();
                if (!an.equals("")) {
                    a.put(attrName.toString(), attrVal.toString());
                }
                attrName.setLength(0);
                attrVal.setLength(0);
                doVal = false;
                doName = true;
            } else if (ch == '=' && doName) {
                doName = false;
                doVal = true;
            } else {
                if (doName) {
                    if ((ch != ' ' && ch != '\r' && ch != '\n') || attrName.length() > 0) {
                        attrName.append(ch);
                    }
                } else if (doVal) {
                    attrVal.append(ch);
                }
            }
        }
        StringBuffer buf = new StringBuffer("<form");
        String sslexUrl = context.toExternalForm();
        if (a.containsKey("action")) {
            try {
                String contextPath = context.toExternalForm();
                if (contextPath.endsWith("/")) {
                    contextPath = contextPath.substring(0, contextPath.length() - 1);
                }               
                String originalAction = a.get("action").toString();
                try {
                  sslexUrl = new URL(originalAction).toExternalForm();
                }
                catch(MalformedURLException murle) {
                  /**
                   * LDP - Bug fix: the commented out code causes problems with relative
                   * URLs used in the action parameter of a form
                   *
                   * Example:
                   *
                   * Context URL:
                   * http://foobar/OA_HTML/AppsLocalLogin.jsp
                   *
                   * Action:
                   * fndvald.jsp
                   *
                   * Results In:
                   *
                   * http://foobar/OA_HTML/AppsLocalLogin.jsp/fndvald.jsp
                   *
                   * Fixed code results in:
                   *
                   * http://foobar/OA_HTML/fndvald.jsp
                   *
                   * Slash should not be a problem because URL is intelligent enough to work out that
                   * the slash means from the root of the URL. I have tested this case and it does indeed
                   * work the same way regardless of the value of originalAction, in fact originalAction
                   * can be a completely different URL for example http://localhost/fndvald.jsp
                   *
                   * Here are the test cases:
                   *
                   * new URL("http://foobar/OA_HTML/AppsLocalLogin.jsp/fndvald.jsp", "fndvald.jsp").toExternalForm();
                   * == http://foobar/OA_HTML/AppsLocalLogin.jsp/fndvald.jsp
                   *
                   * new URL("http://foobar/OA_HTML/AppsLocalLogin.jsp/fndvald.jsp", "/fndvald.jsp").toExternalForm();
                   * == http://foobar/fndvald.jsp
                   *
                   * new URL("http://foobar/OA_HTML/AppsLocalLogin.jsp/fndvald.jsp", "http://localhost/fndvald.jsp").toExternalForm();
                   * == http://localhost/fndvald.jsp
                   */
                  //if(originalAction.startsWith("/")) {
                    sslexUrl = new URL(context, originalAction).toExternalForm();
                  //}
                  //else {
                  //  sslexUrl = new URL(DAVUtilities.concatenatePaths(contextPath, originalAction)).toExternalForm();
                  //}
                }
            } catch (MalformedURLException e) {
              log.error("Failed to process FORM action", e);
            }
        }
       
        a.put("action", "/replacementProxyEngine/" + ticket + "/" + Util.urlEncode(Utils.htmlunescape(sslexUrl)) );

        for (Iterator i = a.entrySet().iterator(); i.hasNext();) {
            buf.append(" ");
            Map.Entry entry = (Map.Entry) i.next();
            buf.append(entry.getKey().toString());
            buf.append("=\"");
            buf.append(entry.getValue());
View Full Code Here

Examples of com.cedarsoftware.util.CaseInsensitiveMap

    /**
     * @return Map (case insensitive keys) containing meta (additional) properties for the n-cube.
     */
    public Map<String, Object> getMetaProperties()
    {
        Map ret = metaProps == null ? new CaseInsensitiveMap() : metaProps;
        return Collections.unmodifiableMap(ret);
    }
View Full Code Here

Examples of net.md_5.bungee.util.CaseInsensitiveMap

            config = (Map) yaml.load( is );
        }

        if ( config == null )
        {
            config = new CaseInsensitiveMap();
        } else
        {
            config = new CaseInsensitiveMap( config );
        }
        // End yaml

        List<String> defaults = new ArrayList<>();
        Object readModules = config.get( "modules" );
View Full Code Here

Examples of org.apache.aries.web.converter.impl.CaseInsensitiveMap

  }

  public URLConnection openConnection(URL url) throws IOException
  {
    // Create properties object
    CaseInsensitiveMap properties = new CaseInsensitiveMap();
    if (url.getQuery() != null)
    {
      String propString = url.getQuery();
      StringTokenizer tok = new StringTokenizer(propString);
      boolean firstProperty = true;
     
      // We now parse the property pairs query string.
      // This has the format name=value&name=value...(etc)
      while (tok.hasMoreElements())
      {
        String name = tok.nextToken("=");
        // "name" will now contain the name of the property we are trying to
        // set. Property pairs are seperated by the '&' symbol. The tokenizer
        // will include this symbol in the token so we need to return it from
        // all property names except the first.
        if (!!!firstProperty)
          name = name.substring(1);
        String value = tok.nextToken("&").substring(1);
        properties.put(name, value);
        firstProperty = false;
      }
    }
       
    return new WARConnection(new URL(url.getPath()), properties);
View Full Code Here

Examples of org.apache.camel.util.CaseInsensitiveMap

     * You can set multiple expectations for different header names.
     * If you set a value of <tt>null</tt> that means we accept either the header is absent, or its value is <tt>null</tt>
     */
    public void expectedHeaderReceived(final String name, final Object value) {
        if (expectedHeaderValues == null) {
            expectedHeaderValues = new CaseInsensitiveMap();
            // we just wants to expects to be called once
            expects(new Runnable() {
                public void run() {
                    for (int i = 0; i < getReceivedExchanges().size(); i++) {
                        Exchange exchange = getReceivedExchange(i);
View Full Code Here

Examples of org.apache.camel.util.CaseInsensitiveMap

        Message in = copy.getIn();
        Object actualBody = in.getBody();

        if (expectedHeaderValues != null) {
            if (actualHeaderValues == null) {
                actualHeaderValues = new CaseInsensitiveMap();
            }
            if (in.hasHeaders()) {
                actualHeaderValues.putAll(in.getHeaders());
            }
        }
View Full Code Here

Examples of org.apache.camel.util.CaseInsensitiveMap

    public void setHeaders(Map<String, Object> headers) {
        if (headers instanceof CaseInsensitiveMap) {
            this.headers = headers;
        } else {
            // wrap it in a case insensitive map
            this.headers = new CaseInsensitiveMap(headers);
        }
    }
View Full Code Here

Examples of org.apache.camel.util.CaseInsensitiveMap

     *
     * @return return a newly constructed Map possibly containing headers from
     *         the underlying inbound transport
     */
    protected Map<String, Object> createHeaders() {
        Map<String, Object> map = new CaseInsensitiveMap();
        populateInitialHeaders(map);
        return map;
    }
View Full Code Here

Examples of org.apache.camel.util.CaseInsensitiveMap

     * You can set multiple expectations for different header names.
     * If you set a value of <tt>null</tt> that means we accept either the header is absent, or its value is <tt>null</tt>
     */
    public void expectedHeaderReceived(final String name, final Object value) {
        if (expectedHeaderValues == null) {
            expectedHeaderValues = new CaseInsensitiveMap();
            // we just wants to expects to be called once
            expects(new Runnable() {
                public void run() {
                    for (int i = 0; i < getReceivedExchanges().size(); i++) {
                        Exchange exchange = getReceivedExchanges().get(i);
View Full Code Here

Examples of org.apache.camel.util.CaseInsensitiveMap

        Message in = copy.getIn();
        Object actualBody = in.getBody();

        if (expectedHeaderValues != null) {
            if (actualHeaderValues == null) {
                actualHeaderValues = new CaseInsensitiveMap();
            }
            if (in.hasHeaders()) {
                actualHeaderValues.putAll(in.getHeaders());
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.