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

Method getBaseName

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

Source from the content-addressed store, hash-verified

124 }
125
126 public FilePath getBaseName() {
127 var name = getFileName();
128 var lastDot = name.lastIndexOf(".");
129 if (lastDot == 0) {
130 throw new IllegalStateException("getBaseName() called on a dotfile: " + value);
131 }
132 if (lastDot < 0) {
133 return this;
134 }
135
136 var split = value.lastIndexOf(".");
137 return FilePath.of(value.substring(0, split));
138 }
139
140 public Optional<String> getExtension() {
141 var name = getFileName();

Callers 15

setupRenameMethod · 0.80
renameFileMethod · 0.80
loadIfNecessaryMethod · 0.80
createOptionsMethod · 0.80
createSimpleMethod · 0.80
createMethod · 0.80
matchesLocaleMethod · 0.80
initMethod · 0.80
getResourcePathMethod · 0.80
getImageMethod · 0.80

Calls 3

getFileNameMethod · 0.95
ofMethod · 0.95
lastIndexOfMethod · 0.80

Tested by 1

getResourcePathMethod · 0.64