java代码从服务器下载文件 [英] java code to download a file from server

查看:239
本文介绍了java代码从服务器下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows中使用java代码我需要从放置在服务器中的目录下载几个文件。服务器中的这些文件是分开生成的。所以我不会知道这些文件的名称。有没有什么办法可以使用JAVA下载并保存到特定的文件夹中。



我使用apache tomcat。

我读了所有其他与java文件下载相关的线程。但是它们都不能满足我的要求。

使用 java.net.URL
解决方案 java.net.URLConnection 类。


using java code in windows i need to download several files from a directory placed in a server. those files in server are generated separately. so i'll not know the name of those files. is there any way to download it using JAVA and saving it in a specific folder.

i am using apache tomcat.

I read all other threads related to java file download. But none of them satisfy my requirement.

解决方案

Use java.net.URL and java.net.URLConnection classes.

这篇关于java代码从服务器下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆