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