From c65f42d8322c299db7fdc8d2b13e6332ebef5149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=95=E6=9C=89=E7=81=B5=E7=8A=80?= <475660@qq.com> Date: Wed, 1 Aug 2018 15:36:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=BC=A0=E3=80=81?= =?UTF-8?q?=E4=B8=8B=E8=BD=BDclient=E5=92=8Capi=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/main/application.properties | 1 + .../Controller/FileUploadDownloadController.java | 3 +-- .../java/xy/FileSystem/Propert/StorageProperties.java | 9 +++++++++ src/main/resources/application.properties | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/main/application.properties b/bin/main/application.properties index 6b15b3e..2936bf8 100644 --- a/bin/main/application.properties +++ b/bin/main/application.properties @@ -11,6 +11,7 @@ storage.debug = true # \u5b58\u50a8\u7684\u76f8\u5bf9\u8def\u5f84\uff0c\u5982\u679c storage.source = xyfs \u9700\u8981\u914d\u7f6e # storage.location = uploadfiledir storage.downloadto = d://downloadfile// +storage.downloadurl = http://localhost:9091/files/ # \u662f\u5426\u91cd\u65b0\u547d\u540d\u6587\u4ef6\u540d\uff0c\u5982\u679c\u662f\u4e2a\u4eba\u6587\u4ef6\u5219\u91cd\u547d\u540d\u4e3a\uff1ausername_ + \u539f\u6587\u4ef6\u540d\uff1b\u5982\u679c\u662f\u7fa4\u7ec4\u6587\u4ef6\u5219\u91cd\u547d\u540d\u4e3a\uff1agroupid_ + \u539f\u6587\u4ef6\u540d # storage.rename = true diff --git a/src/main/java/xy/FileSystem/Controller/FileUploadDownloadController.java b/src/main/java/xy/FileSystem/Controller/FileUploadDownloadController.java index c6b2f5c..c87f89c 100644 --- a/src/main/java/xy/FileSystem/Controller/FileUploadDownloadController.java +++ b/src/main/java/xy/FileSystem/Controller/FileUploadDownloadController.java @@ -208,8 +208,7 @@ public class FileUploadDownloadController { Boolean downloadSuccess = false; downloadSuccess = HttpHelper.executeDownloadFile(HttpHelper.createHttpClient(), - "http://localhost:9091/files/wangxin_Tigase开发文档.doc", //服务器文件 - //"/files/"+filename, //服务器文件 + prop.getDownloadurl() + filename, //服务器文件 prop.getDownloadto() + filename, //下载到本地的文件 "UTF-8", true); diff --git a/src/main/java/xy/FileSystem/Propert/StorageProperties.java b/src/main/java/xy/FileSystem/Propert/StorageProperties.java index d4ddd7c..7b633ab 100644 --- a/src/main/java/xy/FileSystem/Propert/StorageProperties.java +++ b/src/main/java/xy/FileSystem/Propert/StorageProperties.java @@ -7,6 +7,7 @@ public class StorageProperties { private String location = "uploadfiles"; private String downloadto =""; + private String downloadurl =""; private boolean rename = true; private String downloadfrom = ""; private String template = "thymeleaf"; @@ -271,4 +272,12 @@ public class StorageProperties { public void setTemplate(String template) { this.template = template; } + + public String getDownloadurl() { + return downloadurl; + } + + public void setDownloadurl(String downloadurl) { + this.downloadurl = downloadurl; + } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 6b15b3e..2936bf8 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -11,6 +11,7 @@ storage.debug = true # \u5b58\u50a8\u7684\u76f8\u5bf9\u8def\u5f84\uff0c\u5982\u679c storage.source = xyfs \u9700\u8981\u914d\u7f6e # storage.location = uploadfiledir storage.downloadto = d://downloadfile// +storage.downloadurl = http://localhost:9091/files/ # \u662f\u5426\u91cd\u65b0\u547d\u540d\u6587\u4ef6\u540d\uff0c\u5982\u679c\u662f\u4e2a\u4eba\u6587\u4ef6\u5219\u91cd\u547d\u540d\u4e3a\uff1ausername_ + \u539f\u6587\u4ef6\u540d\uff1b\u5982\u679c\u662f\u7fa4\u7ec4\u6587\u4ef6\u5219\u91cd\u547d\u540d\u4e3a\uff1agroupid_ + \u539f\u6587\u4ef6\u540d # storage.rename = true