Examples of Spliterator


Examples of juzu.impl.common.Spliterator

    //
    if ("POST".equals(req.getMethod())) {
      String contentType = req.getContentType();
      if (contentType != null && contentType.length() > 0) {
        Spliterator i = new Spliterator(contentType, ';');
        if ("application/x-www-form-urlencoded".equals(i.next().trim())) {
          Charset charset = defaultEncoding;
          while (i.hasNext()) {
            String v = i.next().trim();
            if (v.startsWith("charset=")) {
              charset = Charset.forName(v.substring("charset=".length()));
            }
          }
          try {
View Full Code Here

Examples of juzu.impl.common.Spliterator

      //
      ClientContext clientContext = request.bridge.getClientContext();
      if (clientContext != null) {
        String contentType = clientContext.getContentType();
        if (contentType != null) {
          Spliterator i = new Spliterator(contentType, ';');

          //
          String mediaType;
          if (i.hasNext()) {
            mediaType = i.next().trim();

            //
            if (!mediaType.equals("application/x-www-form-urlencoded")) {
              for (EntityUnmarshaller reader : Tools.loadService(EntityUnmarshaller.class, request.controllerPlugin.getApplication().getClassLoader())) {
                try {
View Full Code Here

Examples of juzu.impl.common.Spliterator

        //
        String sp = options.get("-sourcepath");
        log.info("Found sourcepath " + sp);
        if (sp != null) {
          // We take the first value
          Spliterator split = new Spliterator(sp, PATH_SEPARATOR_CHAR);
          if (split.hasNext()) {
            File root = new File(split.next());
            if (root.isDirectory()) {
              sourcePath = new DiskFileSystem(root);
            }
          }
        }
View Full Code Here

Examples of org.stringtree.util.iterator.Spliterator

  }

    public void setCookie(String name, String value) {
        Cookie cookie = null;
        if (value.indexOf(';') > 0) {
            Spliterator it = new Spliterator(value, ";");
            if (it.hasNext()) {
                String realValue = it.nextString();
                cookie = makeCookie(name, realValue);
                while (it.hasNext()) {
                    String property = it.nextString().trim();
                    if (property.indexOf('=') > 0) {
                        Spliterator pit = new Spliterator(property, "=");
                        String pname = pit.hasNext() ? pit.nextString().trim() : "";
                        String pvalue = pit.hasNext() ? pit.nextString().trim() : "";
                        if ("path".equals(pname)) cookie.setPath(pvalue);
                        if ("ttl".equals(pname)) cookie.setMaxAge(IntegerNumberUtils.intValue(pvalue, 0));
                    }
                }
            }
View Full Code Here

Examples of org.stringtree.util.iterator.Spliterator

            String pattern = "";
            String application = "";
            String tail = "";
           
            String line = lines.nextString();
            Spliterator words = new BlankPaddedSpliterator(line);
           
            if (words.hasNext()) pattern = words.nextString();
            if (words.hasNext()) application = words.nextString();
            if (words.hasNext()) tail = words.tail();
           
            if (!StringUtils.isBlank(pattern) && !StringUtils.isBlank(application)) {
                String prefix = pattern;
                if ("*".equals(prefix)) prefix = "";
                Object app = ContextClassUtils.ensureObject(application, tail, context, false);
View Full Code Here

Examples of org.stringtree.util.iterator.Spliterator

    private String apptail;
    private Object application;
    private String realm;
   
    public Authorized(String tail) {
        Spliterator it = new Spliterator(tail);
        this.realm = it.hasNext() ? it.nextString() : null;
        this.idkey = it.hasNext() ? convertIdKey(it.nextString()) : null;
        this.mapkey = it.hasNext() ? it.nextString() : null;
        this.appname = it.hasNext() ? it.nextString() : null;
        this.apptail = it.hasNext() ? it.tail().trim() : null;
    }
View Full Code Here

Examples of org.stringtree.util.iterator.Spliterator

       
        String credentials = context.get(HTTPConstants.REQUEST_HEADER_AUTHORIZATION);
        if (credentials.startsWith("Basic ")) {
            credentials = credentials.substring("Basic ".length());
        }
        Spliterator it = new Spliterator(credentials, ":");
        String credId = it.hasNext() ? it.nextString() : "";
        String credPin = it.hasNext() ? it.nextString() : "";
       
        if (!(id.equals(credId) && secret.equals(credPin))) {
            context.put(HTTPConstants.RESPONSE_CODE, "401");
            context.put(HTTPConstants.RESPONSE_HEADER_AUTHENTICATE, "Basic realm=\"" + realm + ":" + id + "\"");
            return;
View Full Code Here

Examples of org.stringtree.util.iterator.Spliterator

        String credentials = context.get(HTTPConstants.REQUEST_HEADER_AUTHORIZATION);
        if (credentials.startsWith("Basic ")) {
            credentials = credentials.substring("Basic ".length());
        }

        Spliterator it = new Spliterator(credentials, ":");
        String credId = it.hasNext() ? it.nextString() : "";
        String credPin = it.hasNext() ? it.nextString() : "";
       
        if (!(id.equals(credId) && secret.equals(credPin))) {
            context.put(HTTPConstants.RESPONSE_CODE, "401");
            context.put(HTTPConstants.RESPONSE_HEADER_AUTHENTICATE, "Basic realm=\"private:" + id + "\"");
            return;
View Full Code Here

Examples of org.stringtree.util.iterator.Spliterator

        this.id = id;
        this.name = name;
    }

    public Item(String tail) {
        Spliterator it = new Spliterator(tail);
        this.id = it.nextString();
        this.name = it.nextString();
    }
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.