derbylock / missing-link

Automatically exported from code.google.com/p/missing-link
0 stars 0 forks source link

Add support for binary content (entity) #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We use missing-link to upload files to a server, as shown below. The first 
scenario (text files) works nicely, whereas the second scenario (binary files) 
works less nice...

  <http url="http://server/upload.php?filename=all.txt" method="PUT">
    <entity file="target/allfiles.txt" />
  </http>
  <http url="http://server/upload.php?filename=all.zip" method="PUT">
    <entity file="target/allfiles.zip" />
  </http>

A suggestion could be an attribute "binary=true" on <entity>:

  <http url="http://server/upload.php?filename=all.zip" method="PUT">
    <entity file="target/allfiles.zip" binary="true" />
  </http>

Original issue reported on code.google.com by eirik.ly...@gmail.com on 3 May 2011 at 12:45

GoogleCodeExporter commented 8 years ago
Here is a diff (svn diff) of a possible implementation, along with a full set 
of sources (the output of ant clean dist).

The concept is like this:
1) First, the EntityNode has a new "binary" attribute
2) Next, in HttpClient, "InputStream entity" has been replaced with "String 
textEntity" and "byte[] binaryEntity", along with proper(?) handling
3) Finally, HttpClientTask has been updated to work with these changes.

Original comment by eirik.ly...@gmail.com on 3 May 2011 at 3:18

Attachments:

GoogleCodeExporter commented 8 years ago
I have made a patch against revision 65 that allows binary content for entity, 
if you're interested you can apply it.

Your test are not changed since I have created new wrapper methods for 
HttpClient#entity

Original comment by david.he...@gmail.com on 3 May 2011 at 3:51

Attachments:

GoogleCodeExporter commented 8 years ago
Excellent! I won't get to verify this until tomorrow (at best), but will get 
back after that :-)

Original comment by eirik.ly...@gmail.com on 3 May 2011 at 4:29

GoogleCodeExporter commented 8 years ago
I'm doing my development under Windows, and don't have the option of applying a 
patch, I think. I'll just wait until it appears under trunk, and run with my 
private fix in the meantime.

Original comment by eirik.ly...@gmail.com on 4 May 2011 at 12:45

GoogleCodeExporter commented 8 years ago
Thanks for the support on this, I will try to get to this tonight and update 
this issue

Original comment by alex.she...@gmail.com on 4 May 2011 at 7:10

GoogleCodeExporter commented 8 years ago
Hi Alex, when can we get the new release with the binary fix? Thanks

Original comment by m.hamma...@gmail.com on 9 May 2011 at 2:47

GoogleCodeExporter commented 8 years ago
Hi, I've just come up against this issue too. I'll try David's patch tomorrow

Original comment by stephens...@googlemail.com on 31 May 2011 at 4:58

GoogleCodeExporter commented 8 years ago

Original comment by alex.she...@gmail.com on 23 Jul 2011 at 3:38

GoogleCodeExporter commented 8 years ago
- Applied user submitted patch for supporting binary entity content by use of a 
"binary" attribute on the entity node.
- Updated documentation to describe the new entity attribute

Original comment by alex.she...@gmail.com on 23 Jul 2011 at 3:43

GoogleCodeExporter commented 8 years ago

Original comment by alex.she...@gmail.com on 23 Jul 2011 at 3:44

GoogleCodeExporter commented 8 years ago

Original comment by alex.she...@gmail.com on 19 Aug 2011 at 12:51