Package se.rupy.http

Examples of se.rupy.http.Input.line()


  public static Item save(Event event, Item item) throws Event, IOException {
    String type = event.query().header("content-type");
    String boundary = "--" + unquote(type.substring(type.indexOf("boundary=") + 9));

    Input in = event.input();
    String line = in.line();

    while(line != null) {
      /*
       * find boundary
       */
 
View Full Code Here


      if(line.equals(boundary + "--")) {
        Sprout.redirect(event, "/");
      }

      if(line.equals(boundary)) {
        line = in.line();

        /*
         * read headers; parse filename and content-type
         */

 
View Full Code Here

            if(name.equals("content-type")) {
              item.type = value;
            }
          }

          line = in.line();
        }

        if(item.name == null || item.name.length() == 0) {
          Sprout.redirect(event, "/");
        }
View Full Code Here

        }

        throw new IOException("Boundary not found. (trailing)");
      }

      line = in.line();
    }

    throw new IOException("Boundary not found. (initing)");
  }
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.