// 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(src fs.Object, remote string) (fs.Object, error) {
	err := f.Mkdir("")
	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 := pathEscape(srcFs.bucket + "/" + srcFs.root + srcObj.remote)
	req := s3.CopyObjectInput{
		Bucket:            &f.bucket,
		Key:               &key,
		CopySource:        &source,
		MetadataDirective: aws.String(s3.MetadataDirectiveCopy),
	}
	_, err = f.c.CopyObject(&req)
	if err != nil {
		return nil, err
	}
	return f.NewObject(remote)
}
func ( f * Fs ) Copy ( src fs . Object , remote string ) ( fs . Object , error ) { err := f . Mkdir ( " " ) 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 := pathEscape ( srcFs . bucket + " " + srcFs . root + srcObj . remote ) req := s3 . CopyObjectInput { Bucket : & f . bucket , Key : & key , CopySource : & source , MetadataDirective : aws . String ( s3 . MetadataDirectiveCopy ) , } _ , err = f . c . CopyObject ( & req ) if err != nil { return nil , err } return f . NewObject ( remote ) }
Copy src to this remote using server side copy operations.
Copy src to this remote using server side copy operations .