You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In commit c42a2c4 an effort is made to create a cache folder if it doesn't exists. I assume this works when the folder is configured using the properties file, but when trying to configure using code, mkdir is called when instantiating CacheHandler, which is called by the WebDriverManager constructor using a default new Config() instance. Thus you can't set any values on config, before the CacheHandler constructor is called.
protected WebDriverManager() {
config = new Config();
cacheHandler = new CacheHandler(config);
httpClient = new HttpClient(config);
downloader = new Downloader(httpClient, config, this::postDownload);
resolutionCache = new ResolutionCache(config);
dockerService = new DockerService(config, httpClient, resolutionCache);
versionDetector = new VersionDetector(config, httpClient);
webDriverList = new CopyOnWriteArrayList<>();
webDriverCreator = new WebDriverCreator(config);
}
calls
public CacheHandler(Config config) {
this.config = config;
File cacheFolder = new File(config.getCachePath());
if (!cacheFolder.exists()) {
cacheFolder.mkdirs();
}
}
At this point cacheFolder can only have its default value.
If you then change config.cacheFolder, webdrivermanager crashes when trying to resolve the non-existent other cache folder, because it is only attempted to be created once, in the constructor.
The mkdir should probably be moved to getCacheFolder.
The text was updated successfully, but these errors were encountered:
In commit c42a2c4 an effort is made to create a cache folder if it doesn't exists. I assume this works when the folder is configured using the properties file, but when trying to configure using code, mkdir is called when instantiating CacheHandler, which is called by the WebDriverManager constructor using a default new Config() instance. Thus you can't set any values on config, before the CacheHandler constructor is called.
calls
At this point cacheFolder can only have its default value.
If you then change config.cacheFolder, webdrivermanager crashes when trying to resolve the non-existent other cache folder, because it is only attempted to be created once, in the constructor.
The mkdir should probably be moved to getCacheFolder.
The text was updated successfully, but these errors were encountered: