private static boolean isValidFileName(String docName) {
    if (docName != null && !docName.isBlank()) {
      try {
        Paths.get(docName);
        return true;
      }
      catch (InvalidPathException ignored) {
      }
    }
    return false;
  }
private static boolean isValidFileName(String docName)