Returns the resulting file or in case of extraction the destination directory (for logging).
| 450 | // Returns the resulting file or in case of extraction the destination |
| 451 | // directory (for logging). |
| 452 | static Try<string> fetch( |
| 453 | const FetcherInfo::Item& item, |
| 454 | const Option<string>& cacheDirectory, |
| 455 | const string& sandboxDirectory, |
| 456 | const Option<string>& frameworksHome, |
| 457 | const Option<Duration>& stallTimeout) |
| 458 | { |
| 459 | LOG(INFO) << "Fetching URI '" << item.uri().value() << "'"; |
| 460 | |
| 461 | if (item.action() == FetcherInfo::Item::BYPASS_CACHE) { |
| 462 | return fetchBypassingCache( |
| 463 | item.uri(), |
| 464 | sandboxDirectory, |
| 465 | frameworksHome, |
| 466 | stallTimeout); |
| 467 | } |
| 468 | |
| 469 | return fetchThroughCache( |
| 470 | item, |
| 471 | cacheDirectory, |
| 472 | sandboxDirectory, |
| 473 | frameworksHome, |
| 474 | stallTimeout); |
| 475 | } |
| 476 | |
| 477 | |
| 478 | // Checks to see if it's necessary to create a fetcher cache directory for this |