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

Method fromString

core/src/main/java/io/xpipe/core/StorePath.java:64–78  ·  view source on GitHub ↗

Creates a new store path from a string representation. @param s the string representation, must be not null and fulfill certain requirements @throws IllegalArgumentException if the string is not valid

(String s)

Source from the content-addressed store, hash-verified

62 * @throws IllegalArgumentException if the string is not valid
63 */
64 public static StorePath fromString(String s) {
65 if (s == null) {
66 throw new IllegalArgumentException("String is null");
67 }
68
69 var split = s.split(String.valueOf(SEPARATOR), -1);
70
71 var names =
72 Arrays.stream(split).map(String::trim).map(String::toLowerCase).toList();
73 if (names.stream().anyMatch(s1 -> s1.isEmpty())) {
74 throw new IllegalArgumentException("Name must not be empty");
75 }
76
77 return new StorePath(names);
78 }
79
80 @Override
81 public String toString() {

Callers 4

parseMethod · 0.45

Calls 3

splitMethod · 0.80
mapMethod · 0.45
isEmptyMethod · 0.45