已签名的 Applet 尝试将 .jar 文件从服务器 URL 复制到本地文件系统。有效,但 .jar 已损坏
我正在尝试编写一个小程序,将文件安装到用户系统,以便与本地 Java 映射实用程序一起使用。我有一个 jar 文件,其中包含 Java 实用程序的主要方法以及与本地映射实用程序一起使用的其他几个文件。
我使用 Apache commons File-IO 中的以下方法:此处的文档
一切看起来工作正常。该文件在运行 Applet 时被复制(系统会提示用户请求权限的警告),此时一切看起来都很好。
然而,当文件运行时,.jar 被损坏,我确实看到文件大小在运行后从 250 kB 变为 0。 什么会导致这种行为?我尝试提取存档并查看内容......我所有的课程似乎都在那里。什么会导致 .jar 像这样“自毁”?
另外,如果我只是正常下载文件。效果很好。当我从签名的小程序下载时,它只会像这样损坏。
预先感谢您的任何见解!
I'm trying to write an applet that installs files to the users system for use with an local Java mapping utility. I have a jar file with the main method for my Java utility along with a couple of other files that are used with my local mapping utility.
I use the following method from the Apache commons File-IO: Documentation here
Everything seemingly works fine. The file is copied upon runnning the Applet (the user is prompted with a warning requesting the permissions) and everything seems fine at this point.
When the file is run, however, the .jar gets corrupted and I literally watch as the file size goes from 250 kB to 0 right after it is run.
What would cause such behavior? I try extracting the archive and looking at the contents...all my classes seem to be there. What would cause a .jar to "self destruct" like this?
Also, if I just download the file normally. It works fine. It only corrupts like this when I download from the signed applet.
Thanks in advance for any insight!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论