| 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() { |