public final class TravisDownloadCache extends Object
DownloadCache
implementation that caches downloaded files in a configured
directory. Cached files that are older than the configured number of builds will be removed.Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log |
Constructor and Description |
---|
TravisDownloadCache(Path path,
int ttl,
int buildNumber) |
Modifier and Type | Method and Description |
---|---|
void |
afterTestSuccess() |
void |
before() |
Path |
getOrDownload(String url,
Path targetDir)
Returns either a cached or newly downloaded version of the given file.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
afterTestFailure, apply
public TravisDownloadCache(Path path, int ttl, int buildNumber)
public void before() throws IOException
before
in interface ExternalResource
IOException
public void afterTestSuccess()
afterTestSuccess
in interface ExternalResource
public Path getOrDownload(String url, Path targetDir) throws IOException
DownloadCache
getOrDownload
in interface DownloadCache
url
- File/directory to downloadtargetDir
- directory to place file inIOException
- if any IO operation failsCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.