Java Web Start:如何将文件写入Windows UNC路径?
我有一个 Java 应用程序,用于将大量数据从用户工作站复制到服务器。 java.io.File 类应该能够很好地处理 UNC 路径,事实上它确实如此,但仅当我在标准执行模型中运行应用程序时。
通过 Web Start 启动应用程序时,尝试打开消息中包含“未找到网络路径”的 FileOutputStream 时,我收到 FileNotFoundException。当我将 jar 下载到 PC 并从命令行启动它时,一切正常。
我的应用程序已签名,并且我在 JNLP 中定义了所有权限。
编辑:我还发现,当我将 UNC 路径映射到驱动器号时,它也可以工作。
I have an Java application for copying large amounts of data from users' workstations to a server. The java.io.File class is supposed to work with UNC paths very well and in fact it does but only when I run the app in standard execution model.
When the application is launched via Web Start I get a FileNotFoundException when trying to open a FileOutputStream with "The network path was not found" in message. Again everything works fine when I download the jar to the PC and lauch it from command line.
My app is signed and i define all-permissions in JNLP.
Edit: I have also discovered that when I map the UNC path to a drive letter it works too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对此没有解决办法。我最终将路径安装为命名卷并通过该卷使用它。
There is no solution to this. I ended up mounting the path as a named volume and using it trough the volume.