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

有关win10系统ZipFile中ZipEntry的getName()方法 (ZipFile中getEntry()同理) #10

Closed
nju-zzp opened this issue May 13, 2020 · 1 comment

Comments

@nju-zzp
Copy link

nju-zzp commented May 13, 2020

问题:zipEntry.getName() 返回的是 "java/lang/Object.class",分隔符为正斜杠'/'
文件路径并不是用File.seperator 即 '' 分隔
但是非zip的文件路径调用File.seperator依然是''
因此不能直接将zipEntry的name与classname进行比较
寻找原因:
https://docs.microsoft.com/zh-cn/dotnet/framework/migration-guide/mitigation-ziparchiveentry-fullname-path-separator
image
问:大家是否有类似问题?还是我自己并不需要纠结此问题就可以解决?

@wym0120
Copy link
Collaborator

wym0120 commented May 13, 2020

做个简单的转换就好了,可以看一下transform方法的实现。这样就可以同时应对新旧版本的问题了

@wym0120 wym0120 closed this as completed May 13, 2020
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

No branches or pull requests

2 participants