MCPcopy Create free account
hub / github.com/1150037361/SpringScan / getUrlChildren

Method getUrlChildren

src/main/java/burp/BurpExtender.java:211–234  ·  view source on GitHub ↗
(String urlStr, Integer n)

Source from the content-addressed store, hash-verified

209
210
211 public List<String> getUrlChildren(String urlStr, Integer n) {
212 try {
213 List<String> subdirectories = new ArrayList<>();
214 URL url = new URL(urlStr);
215 String path = url.getPath();
216 String[] parts = path.split("/");
217 if (parts.length < n) {
218 subdirectories.add("GET ");
219 return subdirectories;
220 } else {
221 StringBuilder sb = new StringBuilder();
222 sb.append("GET ");
223 for (int i = 1; i <= n && i < parts.length; i++) {
224 sb.append("/");
225 sb.append(parts[i]);
226 subdirectories.add(sb.toString());
227 }
228 return subdirectories;
229 }
230 } catch (MalformedURLException e) {
231 System.out.println("Invalid URL");
232 return null;
233 }
234 }
235}

Callers 1

bulidUrlMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected