|
|
|
@ -1,11 +1,9 @@
|
|
|
|
|
package com.docus.server;
|
|
|
|
|
|
|
|
|
|
import com.docus.server.api.scheduling.management.FileApi;
|
|
|
|
|
import com.docus.server.common.download.downLoader.HttpDownloader;
|
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 文件上传下载 API
|
|
|
|
|
*
|
|
|
|
@ -15,11 +13,13 @@ import javax.annotation.Resource;
|
|
|
|
|
@SpringBootTest
|
|
|
|
|
public class FileController {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private FileApi fileApi;
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void test() {
|
|
|
|
|
void test() throws Exception {
|
|
|
|
|
HttpDownloader httpDownloader = new HttpDownloader(null);
|
|
|
|
|
String url = "http://192.168.16.110:9113/sch/file/download2?filePath=collector_packages/20230718/64cdaf49-f45e-4435-b6a3-3466165e7e3b/docus-collector-scheduling.tar.gz";
|
|
|
|
|
String fileName = "test.tar.gz";
|
|
|
|
|
String savePath = "h:\\test";
|
|
|
|
|
httpDownloader.downLoadFromUrl(url, fileName, savePath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|