DescriptionBrett,
About two weeks ago, Erik Kay talked to you and Darin about creating something like URLFetcher that saves the URL body to a file. Before I go too far into implementing this, I want to make sure I am going down a reasonable path. This code review sketches what I intend to do. Please take a look and let me know if it is reasonable, or if there is a better way.
I would like to re-use as much of URLFetcher as possible. I replaced the string that holds the response with an abstract class that receives bytes. Each URLFetcher::Delegate can provide an implementation that receives the bytes. By default, a class that puts the bytes into a string is used.
To make the diff clear, I avoided changing the name of any existing method. To finish this work, I plan to rename URLFetcher to URLFetcherImpl and create a new class URLFetcher class that uses URLFetcherImpl to build a string, and return it as the current class does. A new class URLFileFetcher would use URLFetcherImpl to fetch bytes, and redirect them to a file.
Sam
Patch Set 1 #
Total comments: 2
Patch Set 2 : Allow URLFetcher to save the response as a file. #
Messages
Total messages: 3 (0 generated)
|