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

Method list

jnode-core/src/jnode/robot/FileFix.java:121–162  ·  view source on GitHub ↗

Отправляем %LIST @param link @return @throws SQLException

(Link link)

Source from the content-addressed store, hash-verified

119 * @throws SQLException
120 */
121 private String list(Link link) throws SQLException {
122 StringBuilder sb = new StringBuilder();
123 sb.append("Legend: * - subscribed\n\n========== List of fileareas ==========\n");
124 String[] groups = FtnTools.getOptionStringArray(link,
125 LinkOption.SARRAY_LINK_GROUPS);
126 List<Filearea> areas = ORMManager.get(Filearea.class).getOrderAnd(
127 "name", true);
128 for (Filearea area : areas) {
129 boolean denied = true;
130 if (!"".equals(area.getGroup())) {
131 for (String group : groups) {
132 if (area.getGroup().equals(group)) {
133 denied = false;
134 break;
135 }
136 }
137 } else {
138 denied = false;
139 }
140 if (denied) {
141 continue;
142 }
143 FileSubscription sub = ORMManager.get(FileSubscription.class)
144 .getFirstAnd("filearea_id", "=", area.getId(), "link_id",
145 "=", link.getId());
146
147 if (sub != null) {
148 sb.append("* ");
149 } else {
150 sb.append(" ");
151 }
152 sb.append(area.getName());
153 if (area.getDescription().length() > 0) {
154 sb.append(" - ");
155 sb.append(area.getDescription());
156 }
157 sb.append('\n');
158 }
159 sb.append("========== List of fileareas ==========\n");
160 return sb.toString();
161
162 }
163
164 /**
165 * Отправляем %QUERY

Callers 1

executeMethod · 0.95

Calls 11

getOptionStringArrayMethod · 0.95
getMethod · 0.95
appendMethod · 0.80
getOrderAndMethod · 0.80
getFirstAndMethod · 0.80
getIdMethod · 0.65
equalsMethod · 0.45
getGroupMethod · 0.45
getNameMethod · 0.45
getDescriptionMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected