code: public static final String posixString(Path path)
      {
          String prefix = path.isAbsolute() ? "/" : "";
          String suffix = Files.isDirectory(path) ? "/" : "";
          return StreamSupport.stream(path.spliterator(), false)
                  .map((p)->p.toString())
                  .collect(Collectors.joining("/", prefix, suffix));
      }
docs: Converts path to posix path. Converted path starts with '/' if path is
  absolute and ends with '/' if path is directory.
  @param path
  @return
  @see java.nio.file.Path#isAbsolute()
  @see java.nio.file.Files#