code: public static String join(final String path1, final String path2) {
          if (path1.isEmpty() && path2.isEmpty()) return "";
          if (path1.isEmpty() && !path2.isEmpty()) return path2;
          if (path2.isEmpty() && !path1.isEmpty()) return path1;
          final StringBuilder sb = new StringBuilder(DEFAULT_BUFFER_SIZE);
          sb.append(path1);
          if (sb.charAt(sb.length() - 1) == '/') sb.setLength(sb.length() - 1);
          if (path2.charAt(0) != '/') sb.append('/');
          sb.append(path2);
          return sb.toString();
      }
docs: Join two paths together taking into account leading/trailing slashes.
  @param path1 the first path
  @param path2 the second path
  @return the joins path