Iterable<String> (String path) { String root = FileUtil.extractRootPath(path); if (root == null) return splitInner(path); if (root.length() + 1 == path.length() && path.endsWith("/")) { return Collections.singleton(root); } List<String> tail = splitInner(path.substring(root.length())); return ContainerUtil.concat(Collections.singletonList(root), tail); }