|
@@ -593,6 +593,14 @@ public class CreateObjUtil {
|
|
log.info("删除/mnt/data/下的数据完毕:" + command);
|
|
log.info("删除/mnt/data/下的数据完毕:" + command);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static void ossUtilCp(String fileUrl , String path) throws Exception{
|
|
|
|
+ String command = ConstantCmd.OSS_UTIL_CP + " " + fileUrl + " " + path;
|
|
|
|
+ Long start = System.currentTimeMillis();
|
|
|
|
+ log.info("开始oss下载文件:" + command);
|
|
|
|
+ callshell(command);
|
|
|
|
+ log.info("oss下载文件完成,时间为:" + (System.currentTimeMillis() - start));
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* oss文件下载,支持目录或者单个文件下载
|
|
* oss文件下载,支持目录或者单个文件下载
|
|
* @param fyunType oss类型(oss, aws)
|
|
* @param fyunType oss类型(oss, aws)
|
|
@@ -601,7 +609,7 @@ public class CreateObjUtil {
|
|
* @param path 本地路径
|
|
* @param path 本地路径
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
- public static void ossUtilCp(String fyunType, String bucket, String remoteFilePath , String path) throws Exception{
|
|
|
|
|
|
+ public static void ossDownload(String fyunType, String bucket, String remoteFilePath , String path) throws Exception{
|
|
String optType = remoteFilePath.contains(".") ? "file" : "folder";
|
|
String optType = remoteFilePath.contains(".") ? "file" : "folder";
|
|
String command = String.format(ConstantCmd.FYUN_DOWNLOAD, bucket, remoteFilePath, path, fyunType, optType);
|
|
String command = String.format(ConstantCmd.FYUN_DOWNLOAD, bucket, remoteFilePath, path, fyunType, optType);
|
|
Long start = System.currentTimeMillis();
|
|
Long start = System.currentTimeMillis();
|
|
@@ -618,7 +626,7 @@ public class CreateObjUtil {
|
|
* @param path 本地路径
|
|
* @param path 本地路径
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
- public static void ossUploadUtil(String fyunType, String bucket, String remoteFilePath , String path) throws Exception{
|
|
|
|
|
|
+ public static void ossUpload(String fyunType, String bucket, String remoteFilePath , String path) throws Exception{
|
|
String optType = remoteFilePath.contains(".") ? "file" : "folder";
|
|
String optType = remoteFilePath.contains(".") ? "file" : "folder";
|
|
String command = String.format(ConstantCmd.FYUN_UPLOAD, bucket, path, remoteFilePath, fyunType, optType);
|
|
String command = String.format(ConstantCmd.FYUN_UPLOAD, bucket, path, remoteFilePath, fyunType, optType);
|
|
Long start = System.currentTimeMillis();
|
|
Long start = System.currentTimeMillis();
|