Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat-删除文件加密时的无效判断。 #3829

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants