MCPcopy Create free account
hub / github.com/FongMi/TV / fetch

Method fetch

quickjs/src/main/java/com/fongmi/quickjs/utils/Module.java:22–29  ·  view source on GitHub ↗
(String name)

Source from the content-addressed store, hash-verified

20 }
21
22 public String fetch(String name) {
23 String content = cache.get(name);
24 if (!TextUtils.isEmpty(content)) return content;
25 if (name.startsWith("http")) cache.put(name, content = OkHttp.string(name));
26 else if (name.startsWith("assets")) cache.put(name, content = Asset.read(name));
27 else if (name.startsWith("lib/")) cache.put(name, content = Asset.read("js/" + name));
28 return content;
29 }
30
31 public void clear() {
32 cache.evictAll();

Callers

nothing calls this directly

Calls 6

stringMethod · 0.95
readMethod · 0.95
getMethod · 0.45
isEmptyMethod · 0.45
startsWithMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected