public static String removeTrailingSlash(String path)
  {
    if(path.endsWith("/"))
      return path.substring(0, path.length() - 1);
    else
      return path;
  }
public static String removeTrailingSlash(String path)
  {
    if(path.endsWith("/"))
      return path.substring(0, path.length() - 1);
    else
      return path;
  }
public static String removeTrailingSlash ( String path ) { if ( path . endsWith ( "/" ) ) return path . substring ( 0 , path . length ( ) - 1 ) ; else return path ; }
Removes a trailing slash if exists

@param path
@return the path without a trailing /
Removes a trailing slash if exists