Mercurial Hosting > luan
comparison http/src/luan/modules/http/HttpServicer.java @ 725:a741a3a33423
add url support for multipart/form-data
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 08 Jun 2016 23:13:10 -0600 |
parents | eaf30d5aaf6a |
children | d7371dc8c2e7 |
comparison
equal
deleted
inserted
replaced
724:4f8e30a3ffd0 | 725:a741a3a33423 |
---|---|
31 import luan.LuanMeta; | 31 import luan.LuanMeta; |
32 import luan.LuanPropertyMeta; | 32 import luan.LuanPropertyMeta; |
33 import luan.DeepCloner; | 33 import luan.DeepCloner; |
34 import luan.modules.PackageLuan; | 34 import luan.modules.PackageLuan; |
35 import luan.modules.IoLuan; | 35 import luan.modules.IoLuan; |
36 import luan.modules.LuanUrl; | |
37 import luan.modules.TableLuan; | 36 import luan.modules.TableLuan; |
38 import luan.modules.Utils; | 37 import luan.modules.Utils; |
38 import luan.modules.url.LuanUrl; | |
39 | 39 |
40 | 40 |
41 public final class HttpServicer { | 41 public final class HttpServicer { |
42 private static final Logger logger = LoggerFactory.getLogger(HttpServicer.class); | 42 private static final Logger logger = LoggerFactory.getLogger(HttpServicer.class); |
43 | 43 |
106 final MultiPartInputStream mpis = new MultiPartInputStream(in,contentType,null,null); | 106 final MultiPartInputStream mpis = new MultiPartInputStream(in,contentType,null,null); |
107 mpis.setDeleteOnExit(true); | 107 mpis.setDeleteOnExit(true); |
108 for( Part p : mpis.getParts() ) { | 108 for( Part p : mpis.getParts() ) { |
109 final MultiPartInputStream.MultiPart part = (MultiPartInputStream.MultiPart)p; | 109 final MultiPartInputStream.MultiPart part = (MultiPartInputStream.MultiPart)p; |
110 String name = part.getName(); | 110 String name = part.getName(); |
111 /* | |
112 System.out.println("name = "+name); | |
113 System.out.println("getContentType = "+part.getContentType()); | |
114 System.out.println("getHeaderNames = "+part.getHeaderNames()); | |
115 System.out.println("content-disposition = "+part.getHeader("content-disposition")); | |
116 System.out.println(); | |
117 */ | |
111 Object value; | 118 Object value; |
112 String filename = part.getContentDispositionFilename(); | 119 String filename = part.getContentDispositionFilename(); |
113 if( filename == null ) { | 120 if( filename == null ) { |
114 value = new String(part.getBytes()); | 121 value = new String(part.getBytes()); |
115 } else { | 122 } else { |