Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个独立的基于 Java 的桌面应用程序。此应用程序使用需要定期更新的属性文件(简单文本格式)。为此,此应用程序应连接到远程服务器,读取位于那里的 xml 文件并根据 xml 中的数据更新我的属性文件。我怎样才能做到这一点 ?
使用类 url
URL url = new URL("http://yourremoteserver.com/file_to_be_read.xml"); URLConnection urlConnection = url.openConnection(); InputStream in = new BufferedInputStream(urlConnection.getInputStream());