(dbx sharedLinkClient, baseArg *sharing.GetSharedLinkMetadataArg, relPath, dst string, errOut io.Writer)
| 316 | } |
| 317 | |
| 318 | func downloadSharedLinkRelativeFile(dbx sharedLinkClient, baseArg *sharing.GetSharedLinkMetadataArg, relPath, dst string, errOut io.Writer) error { |
| 319 | arg := sharing.NewGetSharedLinkMetadataArg(baseArg.Url) |
| 320 | arg.Path = sharedLinkAPIPath(relPath) |
| 321 | arg.LinkPassword = baseArg.LinkPassword |
| 322 | |
| 323 | return retryWithBackoff(func() error { |
| 324 | link, contents, err := dbx.GetSharedLinkFileContext(currentContext(), arg) |
| 325 | if err != nil { |
| 326 | return err |
| 327 | } |
| 328 | if contents == nil { |
| 329 | return errors.New("shared link download response did not include file content") |
| 330 | } |
| 331 | defer func() { _ = contents.Close() }() |
| 332 | |
| 333 | return copySharedLinkContentToFile(contents, sharedLinkDownloadSize(link), dst, errOut) |
| 334 | }) |
| 335 | } |
| 336 | |
| 337 | func sharedLinkEntryRelativePath(pathDisplay string, rootName string) (string, error) { |
| 338 | rel := strings.TrimPrefix(pathDisplay, "/") |
no test coverage detected