private boolean endsWithSeparator(String path){
  return path.endsWith("/") || path.endsWith("\\");
}

private boolean endsWithSeparator ( String path ) { return path . endsWith ( "/" ) || path . endsWith ( "\\" ) ; }
returns true if the path ends with a path separator .
