|
@@ -116,7 +116,7 @@ public class DataService {
|
|
|
* @param number
|
|
|
* @throws FileNotFoundException
|
|
|
*/
|
|
|
- public void saveAnnex(Map<String, String> map, String filePath) throws FileNotFoundException {
|
|
|
+ public void saveAnnex(Map<String, String> map, String filePath) {
|
|
|
OSS OSS_CLIENT = new OSSClientBuilder().build(PropKit.get("oss_endpoint"), PropKit.get("oss_accessKey"), PropKit.get("oss_secretKey"));
|
|
|
|
|
|
String fileNameStr[] = filePath.split("/");
|
|
@@ -124,7 +124,13 @@ public class DataService {
|
|
|
String fileStorePath = getFileWithUrl(filePath, fileName);
|
|
|
File file = new File(fileStorePath);
|
|
|
String key = PropKit.get("institution_id") + "/" + fileName;
|
|
|
- InputStream inputStream = new FileInputStream(fileStorePath);
|
|
|
+ InputStream inputStream = null;
|
|
|
+ try {
|
|
|
+ inputStream = new FileInputStream(fileStorePath);
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
Boolean eBoolean = OSS_CLIENT.doesObjectExist(PropKit.get("oss_bucketName"), key);
|
|
|
if (!eBoolean) {
|
|
|
OSS_CLIENT.putObject(PropKit.get("oss_bucketName"), key, inputStream);
|