Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Conversation

@psxjoy
Copy link
Collaborator

@psxjoy psxjoy commented Jun 12, 2024

No description provided.

Copy link
Collaborator

@gongxuanzhang gongxuanzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这不是无效判断

@psxjoy
Copy link
Collaborator Author

psxjoy commented Jun 17, 2024

这不是无效判断

函数的 63行已经有一个文件密码判断的逻辑,和PR上的逻辑相同。我觉得可以做个优化:如果根据后缀名无法判断文件类型,直接通过recognitionExcelType进行判断就可以了。不需要验证文件是否有密码。
不知道我的理解对不对。

 // If there is a password, use the FileMagic first
  if (!StringUtils.isEmpty(readWorkbook.getPassword())) {
      try (BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(file))) {
          return recognitionExcelType(bufferedInputStream);
      }
  }

@gongxuanzhang
Copy link
Collaborator

函数的 63行已经有一个文件密码判断的逻辑,和PR上的逻辑相同。我觉得可以做个优化:如果根据后缀名无法判断文件类型,直接通过recognitionExcelType进行判断就可以了。不需要验证文件是否有密码。
不知道我的理解对不对

你是对的

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants