PathUtil { public static List<String> split(String path) { if (path == null) { return null; } path = fix(path); if (path.length() == 0) { return Collections.emptyList(); } path = path.replaceAll("^/", ""); path = path.replaceAll("/$", ""); String[] ret = path.split("/"); return Arrays.asList(ret); }  static String parentPath(String path); static String fix(String path); static String getExtention(String path); static String concatPath(String path, String child); static String removeExtention(String path); static String getName(String path); static String toUrl(URL resource); static String toUrl(String url); static List<String> split(String path);  }
@Test public void testSplit() { assertNull(PathUtil.split(null)); assertSplit("xyz.txt", "xyz.txt"); assertSplit(" assertSplit(" / / abc/fff/ /xyz.txt/ }