@@ -32,7 +32,6 @@ type Yun139 struct {
3232 PersonalCloudHost string
3333 FamilyCloudHost string
3434 GroupCloudHost string
35- RootPath string
3635}
3736
3837func (d * Yun139 ) Config () driver.Config {
@@ -226,7 +225,7 @@ func (d *Yun139) MakeDir(ctx context.Context, parentDir model.Obj, dirName strin
226225 "accountType" : 1 ,
227226 },
228227 "docLibName" : dirName ,
229- "path" : path . Join (parentDir . GetPath (), parentDir . GetID () ),
228+ "path" : d . dirPath (parentDir ),
230229 }
231230 pathname := "/orchestration/familyCloud-rebuild/cloudCatalog/v1.0/createCloudDoc"
232231 _ , err = d .post (pathname , data , nil )
@@ -239,7 +238,7 @@ func (d *Yun139) MakeDir(ctx context.Context, parentDir model.Obj, dirName strin
239238 },
240239 "groupID" : d .CloudID ,
241240 "parentFileId" : parentDir .GetID (),
242- "path" : path . Join (parentDir . GetPath (), parentDir . GetID () ),
241+ "path" : d . dirPath (parentDir ),
243242 }
244243 pathname := "/orchestration/group-rebuild/catalog/v1.0/createGroupCatalog"
245244 _ , err = d .post (pathname , data , nil )
@@ -324,9 +323,9 @@ func (d *Yun139) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj,
324323 var contentList []string
325324 var catalogList []string
326325 if srcObj .IsDir () {
327- catalogList = append (catalogList , path . Join (srcObj . GetPath (), srcObj . GetID () ))
326+ catalogList = append (catalogList , d . dirPath (srcObj ))
328327 } else {
329- contentList = append (contentList , path . Join (srcObj . GetPath (), srcObj . GetID () ))
328+ contentList = append (contentList , d . dirPath (srcObj ))
330329 }
331330
332331 body := base.Json {
@@ -338,7 +337,7 @@ func (d *Yun139) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj,
338337 "contentList" : contentList ,
339338 "destCatalogID" : dstDir .GetID (),
340339 "destGroupID" : d .CloudID ,
341- "destPath" : path . Join (dstDir . GetPath (), dstDir . GetID () ),
340+ "destPath" : d . dirPath (dstDir ),
342341 "destType" : 0 ,
343342 "srcGroupID" : d .CloudID ,
344343 "srcType" : 0 ,
@@ -439,7 +438,7 @@ func (d *Yun139) Rename(ctx context.Context, srcObj model.Obj, newName string) e
439438 },
440439 "docLibName" : newName ,
441440 "docLibraryID" : srcObj .GetID (),
442- "path" : path . Join (srcObj . GetPath (), srcObj . GetID () ),
441+ "path" : d . dirPath (srcObj ),
443442 }
444443 var resp ModifyCloudDocV2Resp
445444 _ , err = d .andAlbumRequest (pathname , data , & resp )
@@ -845,11 +844,7 @@ func (d *Yun139) Put(ctx context.Context, dstDir model.Obj, stream model.FileStr
845844 }
846845 pathname := "/orchestration/personalCloud/uploadAndDownload/v1.0/pcUploadFileRequest"
847846 if d .isFamily () || d .isGroup () {
848- uploadPath := path .Join (dstDir .GetPath (), dstDir .GetID ())
849- // if dstDir is root folder
850- if dstDir .GetID () == d .RootFolderID {
851- uploadPath = d .RootPath
852- }
847+ uploadPath := d .dirPath (dstDir )
853848 data = d .newJson (base.Json {
854849 "fileCount" : 1 ,
855850 "manualRename" : 2 ,
0 commit comments