DotFileUtils { public static Path undot(final Path path) { if (!path.getFileName().toString().startsWith(".")) { return path; } return path.resolveSibling(path.getFileName().toString().substring(1)); } private  DotFileUtils(); static boolean buildDotFile(final Path path,
                                       final OutputStream out,
                                       final FileAttribute<?>... attrs); static Path dot(final Path path); static Path undot(final Path path); static FileAttribute<?>[] consolidate(final Map<String, Object> props,
                                                 final FileAttribute<?>... attrs);  }
@Test public void undotNonDotFile() { final Path path = create(fs, "/path/to/file.txt", false); final Path converted = DotFileUtils.undot(path); assertEquals(path, converted); }
@Test public void undotDotFile() { final Path path = create(fs, "/path/to/.file.txt", false); final Path undot = create(fs, "/path/to/file.txt", false); final Path converted = DotFileUtils.undot(path); assertEquals(undot, converted); }