MCPcopy Create free account
hub / github.com/annmuor/jnode / rem

Method rem

jnode-core/src/jnode/robot/FileFix.java:241–267  ·  view source on GitHub ↗
(Link link, String area)

Source from the content-addressed store, hash-verified

239 }
240
241 private String rem(Link link, String area) throws SQLException {
242 StringBuilder sb = new StringBuilder();
243 String like = area.replace("*", "%");
244 List<Filearea> areas = ORMManager.get(Filearea.class).getAnd("name",
245 "~", like);
246 if (areas.isEmpty()) {
247 sb.append(area);
248 sb.append(" not found");
249 } else {
250 for (Filearea earea : areas) {
251 sb.append(earea.getName());
252 FileSubscription sub = ORMManager.get(FileSubscription.class)
253 .getFirstAnd("filearea_id", "=", earea.getId(),
254 "link_id", "=", link.getId());
255 if (sub == null) {
256 sb.append(" is not subscribed");
257 } else {
258 ORMManager.get(FileSubscription.class).delete("link_id",
259 "=", link, "filearea_id", "=", earea);
260 sb.append(" unsubscribed");
261 }
262 sb.append('\n');
263 }
264 }
265 sb.append('\n');
266 return sb.toString();
267 }
268
269 @Override
270 protected String getRobotName() {

Callers 1

executeMethod · 0.95

Calls 9

getMethod · 0.95
getAndMethod · 0.80
isEmptyMethod · 0.80
appendMethod · 0.80
getFirstAndMethod · 0.80
getIdMethod · 0.65
getNameMethod · 0.45
deleteMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected