()
| 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(); |