code: public static String addPaths(String path1, String path2)
    {
      if(path1.endsWith("/"))
      {
        if(path2.startsWith("/"))
          return path1.substring(0, path1.length() - 1) + path2;
        else
          return path1 + path2;
      }
      else
      {
        if(path2.startsWith("/"))
          return path1 + path2;
        else
          return path1 + "/" + path2;
      }
    }
docs: Adds 2 paths taking into consideration the /
  
  @param path1
  @param path2
  @return path1 + path2