GS Cache: list member of a tar file
This change adds a feature of GS cache server to list all members of a
tar file as lines of CSV, e.g.
<filename>,<record start>,<record size>,<record end>,<content start>,<content size><content end>
...
This feature is useful when we extract files from a tar by using HTTP
Range header, e.g.
curl -r <content start>-<content end> http://gs-cache/download/path/to/file.tar
Another usecase is extracting some of files and re-create another tar
file:
for f in file_info_list:
reader.seek(f.record_start)
writer.write(reader.read(r.record_size))
BUG=chromium:824580
TEST=Ran unit tests.
Change-Id: I2630a04795e16eb35dcdee46c17db64ba380ca09
Reviewed-on: https://chromium-review.googlesource.com/1047959
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Congbin Guo <guocb@chromium.org>
Reviewed-by: Congbin Guo <guocb@chromium.org>
12 files changed