(String url)
| 19 | } |
| 20 | |
| 21 | @Override |
| 22 | public String fetch(String url) throws Exception { |
| 23 | if (url.startsWith("http")) return http(url); |
| 24 | if (url.startsWith("file")) url = url.substring(7); |
| 25 | return Path.read(new File(url)).split("\\R", 2)[0]; |
| 26 | } |
| 27 | |
| 28 | private String http(String url) throws Exception { |
| 29 | try (Response res = OkHttp.newCall(OkHttp.noRedirect(), url).execute()) { |
nothing calls this directly
no test coverage detected