feat():测试
parent
4190277076
commit
90809ec693
|
@ -100,17 +100,17 @@ public class OSSFileLoad {
|
||||||
System.out.println("bucket不存在");
|
System.out.println("bucket不存在");
|
||||||
return Result.error("bucket不存在");
|
return Result.error("bucket不存在");
|
||||||
}
|
}
|
||||||
Boolean flag_file = ossClient.doesObjectExist(bucketName, fileClassPath+fileName+ MethodSuffix.CLASSSUFFIX);
|
Boolean flag_file = ossClient.doesObjectExist(bucketName, fileClassPath+fileName);
|
||||||
if (!flag_file) {
|
if (!flag_file) {
|
||||||
System.out.println("预下载文件不存在");
|
System.out.println("预下载文件不存在");
|
||||||
return Result.error("预下载文件不存在");
|
return Result.error("预下载文件不存在");
|
||||||
}
|
}
|
||||||
// 本地文件下载路径
|
// 本地文件下载路径
|
||||||
String localPath = "home/class/" + fileName + MethodSuffix.CLASSSUFFIX;
|
String localPath = "home/class/" + fileName ;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 从OSS下载文件
|
// 从OSS下载文件
|
||||||
InputStream inputStream = ossClient.getObject(bucketName, fileClassPath + fileName + MethodSuffix.CLASSSUFFIX).getObjectContent();
|
InputStream inputStream = ossClient.getObject(bucketName, fileClassPath + fileName ).getObjectContent();
|
||||||
File downloadFile = new File(localPath);
|
File downloadFile = new File(localPath);
|
||||||
FileOutputStream outputStream = new FileOutputStream(downloadFile);
|
FileOutputStream outputStream = new FileOutputStream(downloadFile);
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class ALiYunUpload {
|
||||||
ossClient.putObject(putObjectRequest);
|
ossClient.putObject(putObjectRequest);
|
||||||
|
|
||||||
OSSFileLoad.streamingClassDownload(fileName);
|
OSSFileLoad.streamingClassDownload(fileName);
|
||||||
|
System.out.println(fileName);
|
||||||
return Result.success(null,"文件"+fileName+".class"+"存储成功");
|
return Result.success(null,"文件"+fileName+".class"+"存储成功");
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue