public static String ensureEndingSlash(String path){
  return path.charAt(path.length() - 1) != '/' ? (path + "/") : path;
}

public static String ensureEndingSlash ( String path ) { return path . charAt ( path . length ( ) - 1 ) != '/' ? ( path + "/" ) : path ; }
ensures that a path always ends with a slash .
