()
| 62 | } |
| 63 | |
| 64 | public FilePath getRoot() { |
| 65 | if (value.startsWith("/")) { |
| 66 | return FilePath.of("/"); |
| 67 | } else if (value.length() >= 2 && value.charAt(1) == ':') { |
| 68 | // Without the trailing slash, many programs struggle with this |
| 69 | return FilePath.of(value.substring(0, 2) + "\\"); |
| 70 | } else if (value.startsWith("\\\\")) { |
| 71 | var split = split(); |
| 72 | if (split.size() > 0) { |
| 73 | return FilePath.of("\\\\" + split.getFirst()); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | return FilePath.of("/"); |
| 78 | } |
| 79 | |
| 80 | public Path toLocalPath() { |
| 81 | return Path.of(value); |
no test coverage detected