org.linkedin.util-core/src/main/java/org/linkedin/util/io/PathUtils.java
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 /