19
19
import static org .openqa .selenium .Platform .MAC ;
20
20
import static org .openqa .selenium .Platform .WINDOWS ;
21
21
22
- import java .io .IOException ;
23
22
import java .io .InputStream ;
24
- import java .io .Reader ;
25
23
import java .nio .file .Files ;
26
24
import java .nio .file .Path ;
27
25
import java .nio .file .Paths ;
43
41
import org .openqa .selenium .manager .SeleniumManagerOutput .Result ;
44
42
import org .openqa .selenium .os .CommandLine ;
45
43
46
- import io .ous .jtoml .JToml ;
47
- import io .ous .jtoml .Toml ;
48
-
49
44
/**
50
45
* This implementation is still in beta, and may change.
51
46
*
@@ -71,8 +66,6 @@ public class SeleniumManager {
71
66
private static final String DEFAULT_CACHE_PATH = "~/.cache/selenium" ;
72
67
private static final String BINARY_PATH_FORMAT = "/manager/%s/%s" ;
73
68
private static final String HOME = "~" ;
74
- private static final String SE_CONFIG_FILE = "/se-config.toml" ;
75
- private static final String CACHE_PATH_KEY = "cache-path" ;
76
69
private static final String CACHE_PATH_ENV = "SE_CACHE_PATH" ;
77
70
78
71
private static final String EXE = ".exe" ;
@@ -298,25 +291,10 @@ private Level getLogLevel() {
298
291
private Path getBinaryInCache (String binaryName ) {
299
292
String cachePath = DEFAULT_CACHE_PATH .replace (HOME , System .getProperty ("user.home" ));
300
293
301
- // 1. Look for cache path in config file
302
- Path configFile = Paths .get (cachePath + SE_CONFIG_FILE );
303
- if (configFile .toFile ().exists ()) {
304
- try (Reader reader = Files .newBufferedReader (configFile )) {
305
- Toml toml = JToml .parse (reader );
306
- Object cachePathToml = toml .get (CACHE_PATH_KEY );
307
- if (cachePathToml != null ) {
308
- cachePath = cachePathToml .toString ();
309
- }
310
- } catch (IOException e ) {
311
- // Nothing
312
- }
313
- }
314
- else {
315
- // 2. Look for cache path as env
316
- String cachePathEnv = System .getenv (CACHE_PATH_ENV );
317
- if (cachePathEnv != null ) {
318
- cachePath = cachePathEnv ;
319
- }
294
+ // Look for cache path as env
295
+ String cachePathEnv = System .getenv (CACHE_PATH_ENV );
296
+ if (cachePathEnv != null ) {
297
+ cachePath = cachePathEnv ;
320
298
}
321
299
322
300
return Paths .get (cachePath + String .format (BINARY_PATH_FORMAT , SELENIUM_MANAGER_VERSION , binaryName ));
0 commit comments