xpipe-io/xpipe · error · IllegalArgumentException

Separator character ${SEPARATOR} is not allowed in the names

Error message

Separator character ${SEPARATOR} is not allowed in the names

What it means

StorePath.create throws IllegalArgumentException when any name contains the path separator character (SEPARATOR), because a name containing the separator would break the hierarchical path semantics. The thrown message names the offending separator character.

Source

Thrown at app/src/main/java/io/xpipe/app/util/StorePath.java:48

        this.names = names;
    }

    /**
     * Creates a new store path.
     *
     * @throws IllegalArgumentException if any name is not valid
     */
    public static StorePath create(String... names) {
        if (names == null) {
            throw new IllegalArgumentException("Names are null");
        }

        if (Arrays.stream(names).anyMatch(s -> s == null)) {
            throw new IllegalArgumentException("Name is null");
        }

        if (Arrays.stream(names).anyMatch(s -> s.contains("" + SEPARATOR))) {
            throw new IllegalArgumentException("Separator character " + SEPARATOR + " is not allowed in the names");
        }

        if (Arrays.stream(names).anyMatch(s -> s.strip().length() == 0)) {
            throw new IllegalArgumentException("Trimmed entry name is empty");
        }

        return new StorePath(Arrays.stream(names).toList());
    }

    /**
     * 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
     */
    public static StorePath fromString(String s) {
        if (s == null) {
            throw new IllegalArgumentException("String is null");

View on GitHub (pinned to d85ca821ba)

Solutions

  1. Split the input on the separator and pass segments as separate varargs: create(input.split("/"))
  2. Sanitize/strip the separator from names before calling create
  3. Reject or escape user input containing the separator at ingestion time

Example fix

// before
StorePath.create("group", userInput); // userInput = "a/b"
// after
StorePath.create(Stream.concat(Stream.of("group"), Arrays.stream(userInput.split("/"))).toArray(String[]::new));
Defensive patterns

Strategy: validation

Validate before calling

for (String name : names) {
    if (name != null && name.contains(String.valueOf(StorePath.SEPARATOR))) {
        throw new IllegalArgumentException("name contains separator: " + name);
    }
}

Type guard

boolean isSafeName(String name) { return name != null && !name.contains(String.valueOf(StorePath.SEPARATOR)); }

Try / catch

try {
    StorePath.create(names);
} catch (IllegalArgumentException e) {
    logger.error("store path rejected: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Passing any name string that contains SEPARATOR (e.g. a user-supplied or path-derived name like 'a/b'), so the resulting path would be ambiguous.

Common situations: Deriving store names from file system paths or URLs containing '/'; user input pasted with slashes; concatenating hierarchical data into a single name instead of separate name arguments.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of xpipe-io/xpipe@d85ca821ba (2026-09-06). Data as JSON: /api/errors/2d24a31bc84f01b4. Report an issue: GitHub.