alex-sherwin / missing-link

Simple ant http plugin
0 stars 1 forks source link

Optionally skip HTTP GET if outFile already exists #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometimes I don't want to do a HTTP GET if the target file already exists, e.g. 
I've called GET apache-tomcat.zip from Maven Repo1, I want to skip GETs for the 
same resource in the future as I can guarantee it will be unchanged. 

It would be good if I could specify an "update" boolean attribute when 
performing GETs, e.g. 

<http method="GET" url="@{url}" outfile="@{toFile}" printrequest="false" 
printresponse="false" printrequestheaders="false" printresponseheaders="false" 
update="@{update}"/>

Original issue reported on code.google.com by stephens...@googlemail.com on 9 Aug 2011 at 1:41

GoogleCodeExporter commented 9 years ago
Attached patch for review, although HttpClientTask still needs some unit tests

Original comment by stephens...@googlemail.com on 16 Aug 2011 at 10:35

Attachments:

GoogleCodeExporter commented 9 years ago
If the existing guard condition is considered good enough, we should probably 
move it prior to the HTTP call as it is redundant

Original comment by stephens...@googlemail.com on 16 Aug 2011 at 1:46

GoogleCodeExporter commented 9 years ago
Attached improved patch eliminating redundant HTTP call if outFile already 
exists and update == false. Update is true by default, preserving backwards 
compatibility

Original comment by stephens...@googlemail.com on 16 Aug 2011 at 3:57

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by alex.she...@gmail.com on 18 Aug 2011 at 1:15

GoogleCodeExporter commented 9 years ago

Original comment by alex.she...@gmail.com on 18 Aug 2011 at 2:01

GoogleCodeExporter commented 9 years ago
Added an "update" attribute, which decides whether or not an HTTP request 
should be made if saving the response entity to file.  Defaults to "true" for 
backwards compatibility.

Most of the changes were supplied by a user submitted patch from 
http://code.google.com/p/missing-link/issues/detail?id=20#c3

Additional changes were made for logging purposes to gain visibility into this 
behavior

Changes will be available in 1.1.3

Original comment by alex.she...@gmail.com on 18 Aug 2011 at 2:13

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
Thanks you

Iman Tidung

Original comment by imancahy...@gmail.com on 17 Oct 2013 at 4:02

Attachments: