code: private String cleanupFileName(String fileName) {
      String processedFileName = fileName;
  
      // strip off path parts
      if (StringUtils.contains(processedFileName, "/")) {
        processedFileName = StringUtils.substringAfterLast(processedFileName, "/");
      }
      if (StringUtils.contains(processedFileName, "\\")) {
        processedFileName = StringUtils.substringAfterLast(processedFileName, "\\");
      }
  
      // make sure filename does not contain any invalid characters
      processedFileName = Escape.validFilename(processedFileName);
  
      return processedFileName;
    }
docs: Make sure filename contains no invalid characters or path parts
  @param fileName File name
  @return Cleaned up file name