antlibs / ant-http

A fork of missing link Ant HTTP task at Google Code
https://code.google.com/archive/p/missing-link/
Apache License 2.0
7 stars 3 forks source link

[CLOSED] Optionally skip HTTP GET if outFile already exists #20

Closed twogee closed 9 years ago

twogee commented 9 years ago

Issue by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT Originally opened as https://github.com/twogee/missing-link/issues/20


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

twogee commented 9 years ago

Comment by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT


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:

twogee commented 9 years ago

Comment by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT


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

twogee commented 9 years ago

Comment by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT


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:

twogee commented 9 years ago

Comment by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT


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

twogee commented 9 years ago

Comment by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT


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

twogee commented 9 years ago

Comment by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT


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

twogee commented 9 years ago

Comment by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT


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

twogee commented 9 years ago

Comment by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT


Thanks you

Iman Tidung

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

Attachments: