简体   繁体   English

更新JWS部署的应用程序的数据文档

[英]Update data documents for JWS deployed app

I have a swing application that uses many data files, these data files will change time to time. 我有一个使用许多数据文件的swing应用程序,这些数据文件会不时更改。 How can I load these data files on client's machine? 如何将这些数据文件加载到客户端计算机上? Is there any way to create a folder like structure and run a batch file or so? 有什么方法可以创建类似于结构的文件夹并运行批处理文件? Any help is appreciated. 任何帮助表示赞赏。

There are several ways to do this: 做这件事有很多种方法:

  1. Assume you want to ship your application with the datafiles, you may embed them as a zip/jar in your application-jar-file. 假设您希望将应用程序与数据文件一起发送,则可以将它们作为zip / jar嵌入到application-jar-file中。

    Extract the embedded zip to a temporary local file and use ZipFileSystemProvider to extract the content to some place on the disc. 将嵌入式zip解压缩到一个临时本地文件,然后使用ZipFileSystemProvider将内容解压缩到光盘上的某个位置。

    Here is an example how to extract some content from zip/jar-file embedded in a .jar-file downloaded by JWS. 是一个示例,该示例如何从嵌入在JWS下载的.jar文件中的zip / jar文件中提取一些内容。

  2. Same as 1, but skip the zip stuff and instead provide a list of all the resources you want to extract 与1相同,但是跳过zip内容,而是提供要提取的所有资源的列表

  3. One other way is to create the files pragmatically using either java.nio.file (java 7+) or java.io.File 另一种方法是使用java.nio.file (java 7+)或java.io.File实用地创建文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM