// Copy src to this remote using server side copy operations.
//
// This is stored with the remote path given
//
// It returns the destination Object and a possible error
//
// Will only be called if src.Fs().Name() == f.Name()
//
// If it isn't possible then return fs.ErrorCantCopy
Copy src to this remote using server side copy operations.

This is stored with the remote path given

It returns the destination Object and a possible error

Will only be called if src.Fs().Name() == f.Name()

If it isn't possible then return fs.ErrorCantCopy
// Copy src to this remote using server side copy operations . // // This is stored with the remote path given // // It returns the destination Object and a possible error // // Will only be called if src . Fs () . Name () == f . Name () // // If it isn ' t possible then return fs . ErrorCantCopy
func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) {
	err := f.Mkdir(ctx, "")
	if err != nil {
		return nil, err
	}
	srcObj, ok := src.(*Object)
	if !ok {
		fs.Debugf(src, "Can't copy - not same remote type")
		return nil, fs.ErrorCantCopy
	}
	srcFs := srcObj.fs
	key := f.root + remote
	source := path.Join("/"+srcFs.bucket, srcFs.root+srcObj.remote)
	fs.Debugf(f, "Copied, source key is: %s, and dst key is: %s", source, key)
	req := qs.PutObjectInput{
		XQSCopySource: &source,
	}
	bucketInit, err := f.svc.Bucket(f.bucket, f.zone)
	if err != nil {
		return nil, err
	}
	_, err = bucketInit.PutObject(key, &req)
	if err != nil {
		fs.Debugf(f, "Copy Failed, API Error: %v", err)
		return nil, err
	}
	return f.NewObject(ctx, remote)
}
func ( f * Fs ) Copy ( ctx context . Context , src fs . Object , remote string ) ( fs . Object , error ) { err := f . Mkdir ( ctx , " " ) if err != nil { return nil , err } srcObj , ok := src . ( * Object ) if ! ok { fs . Debugf ( src , " " ) return nil , fs . ErrorCantCopy } srcFs := srcObj . fs key := f . root + remote source := path . Join ( " " + srcFs . bucket , srcFs . root + srcObj . remote ) fs . Debugf ( f , " " , source , key ) req := qs . PutObjectInput { XQSCopySource : & source , } bucketInit , err := f . svc . Bucket ( f . bucket , f . zone ) if err != nil { return nil , err } _ , err = bucketInit . PutObject ( key , & req ) if err != nil { fs . Debugf ( f , " " , err ) return nil , err } return f . NewObject ( ctx , remote ) }
Copy src to this remote using server side copy operations.
Copy src to this remote using server side copy operations .