public class HttpCacheController extends HttpConnector
Constructor and Description |
---|
HttpCacheController() |
Modifier and Type | Method and Description |
---|---|
static OpenmlApiResponse |
doApiGetRequest(URL url,
String cacheSuffix,
String ash,
int apiVerboseLevel)
Performs a HTTP get call, and caches it locally, if allowed
|
static File |
getCachedFileFromUrl(URL url,
String cacheSuffix)
Returns a file from the openml server and if allowed, caches it locally (otherwise
returns a temp file)
|
static File |
getCacheLocation(URL url,
String cacheSuffix)
Given a URL to retrieve and a cache suffix, returns the file where it will reside.
|
doApiDeleteRequest, doApiGetRequest, doApiPostRequest, getFileFromUrl, getTempFileFromUrl
public static OpenmlApiResponse doApiGetRequest(URL url, String cacheSuffix, String ash, int apiVerboseLevel) throws Exception
url
- - The URL to do the request oncacheSuffix
- - where to store this file in the cache treeapiVerboseLevel
- - for verbosityash
- - api key to authenticateException
- - Can be: server down, problem with URL, etcpublic static File getCachedFileFromUrl(URL url, String cacheSuffix) throws Exception
url
- - The URL to obtaincacheSuffix
- - path to save the fileException
- - Can be: server down, problem with URL, etcpublic static File getCacheLocation(URL url, String cacheSuffix) throws MalformedURLException
url
- - The URL to obtaincacheSuffix
- - path to save the fileMalformedURLException
- - problem with URLCopyright © 2019 Leiden University, NL. All rights reserved.