code: static String concatFilePathNames(String leftPath,
                                      String rightPath,
                                      String fileSep)
    {
      String leftPathTrimmed = leftPath.trim();
      String rightPathTrimmed = rightPath.trim();
  
      if (leftPathTrimmed.isEmpty())
      {
        return rightPath;
      }
  
      if (leftPathTrimmed.endsWith(fileSep)
          && rightPathTrimmed.startsWith(fileSep))
      {
        return leftPathTrimmed + rightPathTrimmed.substring(1);
      }
      else if (!leftPathTrimmed.endsWith(fileSep)
               && !rightPathTrimmed.startsWith(fileSep))
      {
        return leftPathTrimmed + fileSep + rightPathTrimmed;
      }
      else
      {
        return leftPathTrimmed + rightPathTrimmed;
      }
    }
docs: A small function for concatenating two file paths by making sure one and
  only one path separator is placed between the two paths.
  <p>
  This is necessary since for S3 file name, having different number of file
  separators in a path will mean different files.
  </p>
  <p>
  Typical use case is to concatenate a file name to a directory.
  </p>
  
  @param leftPath  left path
  @param rightPath right path
  @param fileSep   file separator
  @return concatenated file path