I got a project and I would like that it updates when I upload a new version to a server.

My projects are classic Java projects if that helps.

How do I do that?

How do I detect a change of a file in a server without any additional files (no txt and such) ->(eg: md5 (no idea if possible) to compare with a file on local disk)

FTP: Hello.zip (md5 = 123) Local: Hello.zip (md5 = 122)

-> IN PROGRAM: if(FTP_Hello.zip_MD5 != Local_Hello.zip_MD5){ Download(); }

有帮助吗?

解决方案

This is how you should do it -

You can put a periodic check in your application to read http://yourserver.com/yourapp_version.xml

and store relevant information (e.g. current version, and download path for jar/war/ear etc.) in this xml file, put logic in your app to compare its own version to the version written in this file, and if it determines that update is available then download the new jar/war/ear and install according to your environment.

Hope the idea helps.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top