{"record":{"id":"2d24a31bc84f01b4","repo":"xpipe-io/xpipe","slug":"separator-character-separator-is-not-allowed-in","errorCode":null,"errorMessage":"Separator character ${SEPARATOR} is not allowed in the names","messagePattern":"Separator character (.+?) is not allowed in the names","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/xpipe/app/util/StorePath.java","lineNumber":48,"sourceCode":"        this.names = names;\n    }\n\n    /**\n     * Creates a new store path.\n     *\n     * @throws IllegalArgumentException if any name is not valid\n     */\n    public static StorePath create(String... names) {\n        if (names == null) {\n            throw new IllegalArgumentException(\"Names are null\");\n        }\n\n        if (Arrays.stream(names).anyMatch(s -> s == null)) {\n            throw new IllegalArgumentException(\"Name is null\");\n        }\n\n        if (Arrays.stream(names).anyMatch(s -> s.contains(\"\" + SEPARATOR))) {\n            throw new IllegalArgumentException(\"Separator character \" + SEPARATOR + \" is not allowed in the names\");\n        }\n\n        if (Arrays.stream(names).anyMatch(s -> s.strip().length() == 0)) {\n            throw new IllegalArgumentException(\"Trimmed entry name is empty\");\n        }\n\n        return new StorePath(Arrays.stream(names).toList());\n    }\n\n    /**\n     * Creates a new store path from a string representation.\n     *\n     * @param s the string representation, must be not null and fulfill certain requirements\n     * @throws IllegalArgumentException if the string is not valid\n     */\n    public static StorePath fromString(String s) {\n        if (s == null) {\n            throw new IllegalArgumentException(\"String is null\");","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/xpipe-io/xpipe/blob/d85ca821baa46092a320ebb13546d7240adb74f8/app/src/main/java/io/xpipe/app/util/StorePath.java#L30-L66","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Split the input on the separator and pass segments as separate varargs: create(input.split(\"/\"))","Sanitize/strip the separator from names before calling create","Reject or escape user input containing the separator at ingestion time"],"exampleFix":"// before\nStorePath.create(\"group\", userInput); // userInput = \"a/b\"\n// after\nStorePath.create(Stream.concat(Stream.of(\"group\"), Arrays.stream(userInput.split(\"/\"))).toArray(String[]::new));","handlingStrategy":"validation","validationCode":"for (String name : names) {\n    if (name != null && name.contains(String.valueOf(StorePath.SEPARATOR))) {\n        throw new IllegalArgumentException(\"name contains separator: \" + name);\n    }\n}","typeGuard":"boolean isSafeName(String name) { return name != null && !name.contains(String.valueOf(StorePath.SEPARATOR)); }","tryCatchPattern":"try {\n    StorePath.create(names);\n} catch (IllegalArgumentException e) {\n    logger.error(\"store path rejected: {}\", e.getMessage());\n}","preventionTips":["Split path-like inputs on the separator before creating StorePath","Sanitize user-provided names at ingestion","Use one vararg per hierarchy level instead of embedding separators in a single name"],"tags":["validation","path","argument"],"backgroundTag":"invalid-argument-value","analyzedSha":"d85ca821baa46092a320ebb13546d7240adb74f8","analyzedAt":"2026-09-06T14:30:08.251Z","contentChangedAt":"2026-09-06T14:30:08.251Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}