MCPcopy Index your code
hub / github.com/xpipe-io/xpipe / getParent

Method getParent

core/src/main/java/io/xpipe/core/FilePath.java:166–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

164 }
165
166 public FilePath getParent() {
167 var split = split();
168 if (split.size() == 0) {
169 return this;
170 }
171
172 if (split.size() == 1) {
173 return value.startsWith("/") && !value.equals("/") ? FilePath.of("/") : this;
174 }
175
176 return FilePath.of(value.substring(0, value.length() - getFileName().length() - 1));
177 }
178
179 public boolean startsWith(String start) {
180 return startsWith(FilePath.of(start));

Callers

nothing calls this directly

Calls 6

splitMethod · 0.95
ofMethod · 0.95
getFileNameMethod · 0.95
sizeMethod · 0.80
startsWithMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected