Commit e3309767 by 谢明辉

下载指定文件

1 parent f61c8909
...@@ -56,6 +56,9 @@ public class Application implements CommandLineRunner { ...@@ -56,6 +56,9 @@ public class Application implements CommandLineRunner {
private String prefix; private String prefix;
@Value(("${serialnumStr:}")) @Value(("${serialnumStr:}"))
private String serialnumStr; private String serialnumStr;
@Value("${file_path:}")
private String filePath;
@Override @Override
public void run(String... args) throws Exception { public void run(String... args) throws Exception {
...@@ -70,6 +73,18 @@ public class Application implements CommandLineRunner { ...@@ -70,6 +73,18 @@ public class Application implements CommandLineRunner {
// System.exit(2); // System.exit(2);
// } // }
if (!"".equals(filePath)) {
try {
File file = new File("d:\\" + filePath.replace("\\", "/"));
ossClientEntity.getOssClient().getObject(new GetObjectRequest(ossClientEntity.getBucket(), filePath), file);
} catch (Exception e) {
System.exit(0);
}
System.exit(0);
}
List<String> filePathList = new ArrayList<>(); List<String> filePathList = new ArrayList<>();
if (!serialnumStr.isEmpty()) { if (!serialnumStr.isEmpty()) {
String[] serialnums = serialnumStr.split(","); String[] serialnums = serialnumStr.split(",");
......
...@@ -26,6 +26,10 @@ date.end=20180825 ...@@ -26,6 +26,10 @@ date.end=20180825
flag=mysql flag=mysql
server.port=8888 server.port=8888
##########
prefix=picture/body/20190402/ prefix=picture/body/20190402/
serialnumStr=0269-F060-E72E-52FE-01,00FE-63D0-0345-CA16-01 serialnumStr=0269-F060-E72E-52FE-01,00FE-63D0-0345-CA16-01
#### assigned to a specific file\u2018s path
file_path=staff/face/upload/6450f60a-5f6f-408f-a75a-b417cdc6302d.jpg
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!