本文介紹了從服務器下載文件的java代碼的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
在 Windows 中使用 java 代碼我需要從放置在服務器中的目錄下載幾個文件.服務器中的那些文件是單獨生成的.所以我不知道這些文件的名稱.有沒有辦法使用JAVA下載它并將其保存在特定文件夾中.
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.
我正在使用 apache tomcat.
i am using apache tomcat.
我閱讀了與 java 文件下載相關的所有其他線程.但是沒有一個能滿足我的要求.
I read all other threads related to java file download. But none of them satisfy my requirement.
推薦答案
使用 java.net.URL
和 java.net.URLConnection
類.
這篇關于從服務器下載文件的java代碼的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!