public Map<String, CacheInfo> call() throws IOException {
Map<String, CacheInfo> results = new HashMap<String, CacheInfo>();
FileList.Reader reader = provider.openReader();
try {
while (reader.next()) {
FileProtocol protocol = reader.getCurrentProtocol();
// receive only header
reader.openContent().close();
if (protocol.getKind() == FileProtocol.Kind.RESPONSE_CACHE_INFO) {
assert protocol.getInfo() != null;
results.put(protocol.getLocation(), protocol.getInfo());
} else if (protocol.getKind() != FileProtocol.Kind.RESPONSE_NOT_FOUND
&& protocol.getKind() != FileProtocol.Kind.RESPONSE_ERROR) {
throw new IOException(MessageFormat.format(
"Unknown protocol in response: {0}",
protocol));
}
}