Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(120)

Issue 21069: Support for multipart/form-data @ JsonRpcServlet (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 11 months ago by Sachin Shenoy
Modified:
16 years, 6 months ago
Reviewers:
louiscryan, awiner
CC:
shindig-dev_incubator.apache.org
Base URL:
http://svn.apache.org/repos/asf/incubator/shindig/trunk/
Visibility:
Public.

Description

As per the RPC Spec for content upload, shindig needs to support multipart/form-data handling. This does the required changes to support it. https://issues.apache.org/jira/browse/SHINDIG-938

Patch Set 1 #

Total comments: 10

Patch Set 2 : I have addressed the comments. Please have another look. Thanks! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+702 lines, -34 lines) Patch
java/common/pom.xml View 1 chunk +4 lines, -0 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/protocol/BaseRequestItem.java View 1 5 chunks +13 lines, -0 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/protocol/DefaultHandlerRegistry.java View 6 chunks +29 lines, -10 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/protocol/JsonRpcServlet.java View 1 7 chunks +78 lines, -12 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/protocol/RequestItem.java View 1 2 chunks +3 lines, -0 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/protocol/RpcHandler.java View 2 chunks +3 lines, -1 line 0 comments Download
java/common/src/main/java/org/apache/shindig/protocol/multipart/CommonsFormDataItem.java View 1 chunk +62 lines, -0 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/protocol/multipart/DefaultMultipartFormParser.java View 1 chunk +61 lines, -0 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/protocol/multipart/FormDataItem.java View 1 chunk +81 lines, -0 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/protocol/multipart/MultipartFormParser.java View 1 chunk +29 lines, -0 lines 0 comments Download
java/common/src/test/java/org/apache/shindig/protocol/BaseRequestItemTest.java View 1 chunk +1 line, -1 line 0 comments Download
java/common/src/test/java/org/apache/shindig/protocol/DefaultHandlerRegistryTest.java View 5 chunks +5 lines, -5 lines 0 comments Download
java/common/src/test/java/org/apache/shindig/protocol/JsonRpcServletTest.java View 1 8 chunks +106 lines, -2 lines 0 comments Download
java/common/src/test/java/org/apache/shindig/protocol/multipart/DefaultMultipartFormParserTest.java View 1 1 chunk +215 lines, -0 lines 0 comments Download
java/social-api/src/main/java/org/apache/shindig/social/opensocial/service/SocialRequestItem.java View 2 chunks +7 lines, -3 lines 0 comments Download
pom.xml View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 4
Sachin Shenoy
16 years, 11 months ago (2009-02-25 08:09:29 UTC) #1
louiscryan
Looks good. http://codereview.appspot.com/21069/diff/1/15 File java/common/src/main/java/org/apache/shindig/protocol/JsonRpcServlet.java (right): http://codereview.appspot.com/21069/diff/1/15#newcode94 Line 94: Map<String, FormDataItem> formItems = new HashMap<String, ...
16 years, 11 months ago (2009-02-26 06:10:20 UTC) #2
Sachin Shenoy
I have addressed the comments. Please have another look. Thanks!
16 years, 11 months ago (2009-02-26 16:42:37 UTC) #3
Sachin Shenoy
16 years, 11 months ago (2009-02-26 16:45:18 UTC) #4
Thanks for the review. Please have another look.

http://codereview.appspot.com/21069/diff/1/15
File java/common/src/main/java/org/apache/shindig/protocol/JsonRpcServlet.java
(right):

http://codereview.appspot.com/21069/diff/1/15#newcode94
Line 94: Map<String, FormDataItem> formItems = new HashMap<String,
FormDataItem>();
On 2009/02/26 06:10:20, louiscryan wrote:
> while the spec doesnt cover it, it may also be worthwhile detecting the first
> content block of application/json and assuming it is the request. The form
field
> named request is only needed when posting out of a browser.

Done.

http://codereview.appspot.com/21069/diff/1/15#newcode246
Line 246: if (!"post".equals(request.getMethod().toLowerCase())) {
On 2009/02/26 06:10:20, louiscryan wrote:
> Http methods are always uppercase

Done.

http://codereview.appspot.com/21069/diff/1/12
File java/common/src/main/java/org/apache/shindig/protocol/RequestItem.java
(right):

http://codereview.appspot.com/21069/diff/1/12#newcode82
Line 82: FormDataItem getFormItem(String partName);
On 2009/02/26 06:10:20, louiscryan wrote:
> name is a little generic. FormMimePart instead?

Done.

http://codereview.appspot.com/21069/diff/1/3
File
java/common/src/test/java/org/apache/shindig/protocol/multipart/DefaultMultipartFormParserTest.java
(right):

http://codereview.appspot.com/21069/diff/1/3#newcode52
Line 52: * Helper class to create the mulitpart/form-data body of he POST
request.
On 2009/02/26 06:10:20, louiscryan wrote:
> ...of the POST...

Done.

http://codereview.appspot.com/21069/diff/1/3#newcode54
Line 54: private static class MultipartFormBuilder {
On 2009/02/26 06:10:20, louiscryan wrote:
> Is there nothing that already allows you to fake this up easily in the commons
> library or elsewhere?
I am not sure. A light search did not get anything.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b