|
@@ -342,23 +342,20 @@ public class AsyncPictureUpload {
|
|
String ossUrl = awaitUploadList.get(num).getOssUrl();
|
|
String ossUrl = awaitUploadList.get(num).getOssUrl();
|
|
fileKey = awaitUploadList.get(num).getNotifyKey();
|
|
fileKey = awaitUploadList.get(num).getNotifyKey();
|
|
if (!ossUrl.isEmpty()){
|
|
if (!ossUrl.isEmpty()){
|
|
- // 找到最后一个斜杠的位置
|
|
|
|
- int lastSlashIndex = ossUrl.lastIndexOf('/');
|
|
|
|
- // 如果找到了斜杠,则从斜杠之后的位置开始切割
|
|
|
|
- fileName = ossUrl.substring(lastSlashIndex + 1);
|
|
|
|
-
|
|
|
|
- //斜杆开始不允许
|
|
|
|
- int firstSlashIndex = ossUrl.indexOf('/');
|
|
|
|
- if (firstSlashIndex==0){
|
|
|
|
- path_prefix = ossUrl.substring(1,lastSlashIndex+ 1);
|
|
|
|
- }else{
|
|
|
|
- path_prefix = ossUrl.substring(0,lastSlashIndex+ 1);
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
+ String[] urlArr = ossUrl.split("/");
|
|
|
|
+ fileName = urlArr[urlArr.length-1];
|
|
|
|
+
|
|
|
|
+ //用户循环路径
|
|
|
|
+ for (int i = 0; i <urlArr.length -1 ; i++) {
|
|
|
|
+ if (!urlArr[i].isEmpty()){
|
|
|
|
+ path_prefix = path_prefix.concat(urlArr[i]).concat("/");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
}else{
|
|
}else{
|
|
- path_prefix = resourcePrefix+"/android/"+mPrefix+"/"+RxTimeTool.getYestoryDate("yyyyMMd")+"/";
|
|
|
|
|
|
+ path_prefix = resourcePrefix + "/android/" + mPrefix + "/" + RxTimeTool.getYestoryDate("yyyyMMd") + "/";
|
|
String fileSuffix = urlPath.lastIndexOf(".")>-1 ? urlPath.substring(urlPath.lastIndexOf(".")) : "";
|
|
String fileSuffix = urlPath.lastIndexOf(".")>-1 ? urlPath.substring(urlPath.lastIndexOf(".")) : "";
|
|
fileName = UUID.randomUUID().toString() + fileSuffix;
|
|
fileName = UUID.randomUUID().toString() + fileSuffix;
|
|
}
|
|
}
|
|
@@ -366,16 +363,16 @@ public class AsyncPictureUpload {
|
|
|
|
|
|
if (resourceType.equals("tencent")){
|
|
if (resourceType.equals("tencent")){
|
|
if (cosService==null){
|
|
if (cosService==null){
|
|
- cosService = new CosService(mActivity.getBaseContext(),path_prefix);
|
|
|
|
|
|
+ cosService = new CosService(mActivity.getBaseContext(), path_prefix.toString());
|
|
}
|
|
}
|
|
//new cosThread(urlPath, fileName , num).start();
|
|
//new cosThread(urlPath, fileName , num).start();
|
|
- cosService.cosUpload(urlPath, fileName , num,uploadHandler,path_prefix);
|
|
|
|
|
|
+ cosService.cosUpload(urlPath, fileName , num,uploadHandler, path_prefix.toString());
|
|
|
|
|
|
}else{
|
|
}else{
|
|
if (ossService ==null){
|
|
if (ossService ==null){
|
|
- ossService = new OssService(mActivity,path_prefix);
|
|
|
|
|
|
+ ossService = new OssService(mActivity, path_prefix.toString());
|
|
}
|
|
}
|
|
- ossService.ossUpload(urlPath, fileName , num,uploadHandler,path_prefix);
|
|
|
|
|
|
+ ossService.ossUpload(urlPath, fileName , num,uploadHandler, path_prefix.toString());
|
|
//ossService.ossUpload(urlPath, fileName , num,uploadHandler);
|
|
//ossService.ossUpload(urlPath, fileName , num,uploadHandler);
|
|
|
|
|
|
}
|
|
}
|