When I was looking into form processing in MSF4J, I was looking at
modifying apache commons [1][2] to meet our needs since it has multipart
support and it is widely used with servlets. But IMO we wont be able to use
it directly out of the box as a library to parse the byte buffer we have
because it starts processing from a servlet request object.

[1] - https://commons.apache.org/proper/commons-fileupload/using.html
[2] - https://commons.apache.org/proper/commons-fileupload/streaming.html

On Wed, May 11, 2016 at 11:18 AM, Himasha Guruge <himas...@wso2.com> wrote:

> In C4 we have used [1] for this purpose.
>
> [1] http://cxf.apache.org/docs/jax-rs-multiparts.html
>
> On Wed, May 11, 2016 at 11:12 AM, Afkham Azeez <az...@wso2.com> wrote:
>
>> Any libraries you are familiar with? Since BPS folks are using the code
>> from the MSF4J master branch, we may be able to quickly implement it.
>>
>> On Wed, May 11, 2016 at 11:09 AM, Samiyuru Senarathne <samiy...@wso2.com>
>> wrote:
>>
>>> Hi Azeez,
>>>
>>> Yes I looked at this sometime back. But it was not progressed to the
>>> implementation level.
>>>
>>> For the moment we will have to use a multipart/form-data parsing library
>>> to parse the raw HTTP body. We can get the raw HTTP body by injecting an
>>> org.wso2.msf4j.Request object to the resource method using @Context
>>> annotation.
>>>
>>> Best Regards,
>>> Samiyuru
>>>
>>> On Wed, May 11, 2016 at 11:02 AM, Afkham Azeez <az...@wso2.com> wrote:
>>>
>>>> Samiyuru,
>>>> You looked at this some time back right? What work is involved in
>>>> implementing this?
>>>>
>>>> Azeez
>>>>
>>>> On Wed, May 11, 2016 at 11:00 AM, Himasha Guruge <himas...@wso2.com>
>>>> wrote:
>>>>
>>>>> From the offline discussion with Azeez, it seems that this is not
>>>>> supported in current msf4j implementation. How are we to proceed with the
>>>>> use case of acquiring form field values from the request?
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Apr 6, 2016 at 11:22 AM, Himasha Guruge <himas...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I have gone through the available sample [1]  on how to process a
>>>>>> stream and read and save files in msf4j. However given a request with 
>>>>>> form
>>>>>> fields like [2] , how can we retrieve those form fields in msf4j? If it 
>>>>>> is
>>>>>> to read from the stream itself, any suggested way to do this?
>>>>>>
>>>>>> [1]
>>>>>> https://github.com/wso2/msf4j/blob/652435ee7f8fdf31307667adb888e9a13513f6d8/samples/petstore/microservices/fileserver/src/main/java/org/wso2/msf4j/examples/petstore/fileserver/FileServerService.java
>>>>>>
>>>>>> [2] curl --form
>>>>>> "fileupload=@Desktop/bigdot.png;filename=desired-filename.txt" --form
>>>>>> param1=value1 --form param2=value2
>>>>>> http://localhost:8080/bps/repo/stream
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Himasha Guruge
>>>>>> *Software Engineer*
>>>>>> WS*O2* *Inc.*
>>>>>> Mobile: +94 777459299
>>>>>> himas...@wso2.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Himasha Guruge
>>>>> *Software Engineer*
>>>>> WS*O2* *Inc.*
>>>>> Mobile: +94 777459299
>>>>> himas...@wso2.com
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> Dev@wso2.org
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> *Afkham Azeez*
>>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>>> Member; Apache Software Foundation; http://www.apache.org/
>>>> * <http://www.apache.org/>*
>>>> *email: **az...@wso2.com* <az...@wso2.com>
>>>> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
>>>> *http://blog.afkham.org* <http://blog.afkham.org>
>>>> *twitter: **http://twitter.com/afkham_azeez*
>>>> <http://twitter.com/afkham_azeez>
>>>> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
>>>> <http://lk.linkedin.com/in/afkhamazeez>*
>>>>
>>>> *Lean . Enterprise . Middleware*
>>>>
>>>
>>>
>>>
>>> --
>>> Samiyuru Senarathne
>>> *Software Engineer*
>>> Mobile : +94 (0) 71 134 6087
>>> samiy...@wso2.com
>>>
>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com
>> Member; Apache Software Foundation; http://www.apache.org/
>> * <http://www.apache.org/>*
>> *email: **az...@wso2.com* <az...@wso2.com>
>> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
>> *http://blog.afkham.org* <http://blog.afkham.org>
>> *twitter: **http://twitter.com/afkham_azeez*
>> <http://twitter.com/afkham_azeez>
>> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
>> <http://lk.linkedin.com/in/afkhamazeez>*
>>
>> *Lean . Enterprise . Middleware*
>>
>
>
>
> --
> Himasha Guruge
> *Software Engineer*
> WS*O2* *Inc.*
> Mobile: +94 777459299
> himas...@wso2.com
>



-- 
Samiyuru Senarathne
*Software Engineer*
Mobile : +94 (0) 71 134 6087
samiy...@wso2.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to