PathUtils { public static String unixPath(@NotNull String first, String... more) { return separatorsToUnix(Paths.get(first, more).toString()); } private  PathUtils(); static String unixPath(@NotNull String first, String... more); static String unixPath(@NotNull Path path); @NotNull static String unixPathEndingWithSeparator(@NotNull String first, String... more); @NotNull static String unixPathEndingWithSeparator(@NotNull Path path); static String extractName(String nameWithPath); static String extractPath(String nameWithPath); static String extractNameFromUniqueEntityName(String uniqueName);  }
@Test void unixPath() { assertEquals("test", PathUtils.unixPath("test")); assertEquals("test/path", PathUtils.unixPath("test", "path")); assertEquals("test/path", PathUtils.unixPath("test\\path")); assertEquals("test/path/subpath", PathUtils.unixPath("test", "path", "subpath")); assertEquals("test/path/subpath", PathUtils.unixPath("test\\path\\subpath")); }
@Test void unixPathFromPathObject() { assertEquals("test", PathUtils.unixPath(Paths.get("test"))); assertEquals("test/path", PathUtils.unixPath(Paths.get("test", "path"))); assertEquals("test/path/subpath", PathUtils.unixPath(Paths.get("test", "path", "subpath"))); }