prepareRemoteDestination will return a new destination URL for remote->remote and local->remote copy operations.
( srcurl *url.URL, dsturl *url.URL, flatten bool, isBatch bool, )
| 908 | // prepareRemoteDestination will return a new destination URL for |
| 909 | // remote->remote and local->remote copy operations. |
| 910 | func prepareRemoteDestination( |
| 911 | srcurl *url.URL, |
| 912 | dsturl *url.URL, |
| 913 | flatten bool, |
| 914 | isBatch bool, |
| 915 | ) *url.URL { |
| 916 | objname := srcurl.Base() |
| 917 | if isBatch && !flatten { |
| 918 | objname = srcurl.Relative() |
| 919 | } |
| 920 | |
| 921 | if dsturl.IsPrefix() || dsturl.IsBucket() { |
| 922 | dsturl = dsturl.Join(objname) |
| 923 | } |
| 924 | return dsturl |
| 925 | } |
| 926 | |
| 927 | // prepareDownloadDestination will return a new destination URL for |
| 928 | // remote->local copy operations. |