MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / handleBy

Method handleBy

src/main/java/fielded/boxbrowser/BoxBrowser.java:127–138  ·  view source on GitHub ↗
(Predicate<Box> b, String propName)

Source from the content-addressed store, hash-verified

125 "<script src='/field/filesystem/field-boxbrowser.js'></script>" +
126 "</head><body><div class='all'>";
127 static public final String postamble = "</div></body>";
128
129 private NanoHTTPD.Response handleBy(Predicate<Box> b, String propName) {
130
131 Optional<Box> first = root.breadthFirst(root.both())
132 .filter(b)
133 .findFirst();
134
135 if (!first.isPresent())
136 return new NanoHTTPD.Response(NanoHTTPD.Response.Status.NOT_FOUND, null, "can't find box matching request");
137
138 if (propName != null) return handleBox(first.get(), new Dict.Prop<>(propName));
139 else return handleBoxAllProperties(first.get());
140 }
141

Callers 1

loadedMethod · 0.95

Calls 6

handleBoxMethod · 0.95
breadthFirstMethod · 0.80
isPresentMethod · 0.80
getMethod · 0.65
bothMethod · 0.45

Tested by

no test coverage detected