Mercurial Hosting > luan
diff src/luan/lib/webserver/Request.java @ 1347:643cf1c37723
move webserver to lib and bug fixes
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 25 Feb 2019 13:02:33 -0700 |
parents | src/luan/webserver/Request.java@383f924dfe9d |
children | 4c5548a61d4f |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/luan/lib/webserver/Request.java Mon Feb 25 13:02:33 2019 -0700 @@ -0,0 +1,35 @@ +package luan.lib.webserver; + +import java.util.Map; +import java.util.LinkedHashMap; +import java.util.Collections; + + +public class Request { + public volatile String rawHead; + public volatile String method; + public volatile String rawPath; + public volatile String path; + public volatile String protocol; // only HTTP/1.1 is accepted + public volatile String scheme; + public final Map<String,Object> headers = Collections.synchronizedMap(new LinkedHashMap<String,Object>()); + public final Map<String,Object> parameters = Collections.synchronizedMap(new LinkedHashMap<String,Object>()); + public final Map<String,String> cookies = Collections.synchronizedMap(new LinkedHashMap<String,String>()); + public volatile byte[] body; + + public static final class MultipartFile { + public final String filename; + public final String contentType; + public final Object content; // byte[] or String + + public MultipartFile(String filename,String contentType,Object content) { + this.filename = filename; + this.contentType = contentType; + this.content = content; + } + + public String toString() { + return "{filename="+filename+", content="+content+"}"; + } + } +}