@Mario248
Do not escape the entire path, just escape the name of file here i.e. tco[a].jpg
JcrUtil.createPath("parentCategoty/" + JcrUtil.escapeIllegalJcrChars("tco[a].jpg"),JcrConstants.NT_UNSTRUCTURED, session);
If you want to validate each node name in path then
String[] nodesArray = path.sp...