|
@@ -91,14 +91,14 @@ public class UploadToOssUtil {
|
|
public void uploadOss(String filePath, String key1){
|
|
public void uploadOss(String filePath, String key1){
|
|
OSSClient ossClient = new OSSClient(point, key, secrey);
|
|
OSSClient ossClient = new OSSClient(point, key, secrey);
|
|
try {
|
|
try {
|
|
- System.out.println("oss-path:"+key1);
|
|
|
|
|
|
+ log.info("upload-to-oss:file-path:{},oss-path:{}",filePath,key1);
|
|
File file = new File(filePath);
|
|
File file = new File(filePath);
|
|
if (!file.exists()) {
|
|
if (!file.exists()) {
|
|
|
|
+ log.info("upload-to-oss:file-path:{},oss-path:{},filePath不存在!",filePath,key1);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
ObjectMetadata metadata = new ObjectMetadata();
|
|
ObjectMetadata metadata = new ObjectMetadata();
|
|
ossClient.putObject(bucket, key1, new File(filePath), metadata);
|
|
ossClient.putObject(bucket, key1, new File(filePath), metadata);
|
|
-
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
} finally {
|
|
} finally {
|