MCPcopy Create free account
hub / github.com/GateNLP/gate-core / getName

Method getName

src/main/java/gate/creole/Plugin.java:568–590  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

566 }
567
568 @Override
569 public String getName() {
570 if(name != null) return name;
571
572 // url.getPath() works for jar URLs; url.toURI().getPath() doesn't
573 // because jars aren't considered "hierarchical"
574 name = getBaseURL().getPath();
575 if(name.endsWith("/")) {
576 name = name.substring(0, name.length() - 1);
577 }
578 int lastSlash = name.lastIndexOf("/");
579 if(lastSlash != -1) {
580 name = name.substring(lastSlash + 1);
581 }
582 try {
583 // convert to (relative) URI and extract path. This will
584 // decode any %20 escapes in the name.
585 name = new URI(name).getPath();
586 } catch(URISyntaxException ex) {
587 // ignore, this should have been checked when adding the URL!
588 }
589 return name;
590 }
591 }
592
593 public static class Maven extends Plugin

Callers 1

registerBuiltinsMethod · 0.95

Calls 3

getBaseURLMethod · 0.45
lengthMethod · 0.45
lastIndexOfMethod · 0.45

Tested by

no test coverage detected