code: public static String addFolderSlashIfNeeded(String folderName) {
          if (!"".equals(folderName) && !folderName.endsWith("/")) {
              return folderName + "/";
          } else {
              return folderName;
          }
      }
docs: Adds a slash to a path if it doesn't end with a slash.
  
  @param folderName The path to append a possible slash.
  @return The new, correct path.