Return an Object from a path If it can't be found it returns the error fs.ErrorObjectNotFound.
(ctx context.Context, remote string, info *storage.Object)
| 637 | // |
| 638 | // If it can't be found it returns the error fs.ErrorObjectNotFound. |
| 639 | func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *storage.Object) (fs.Object, error) { |
| 640 | o := &Object{ |
| 641 | fs: f, |
| 642 | remote: remote, |
| 643 | } |
| 644 | if info != nil { |
| 645 | o.setMetaData(info) |
| 646 | } else { |
| 647 | err := o.readMetaData(ctx) // reads info and meta, returning an error |
| 648 | if err != nil { |
| 649 | return nil, err |
| 650 | } |
| 651 | } |
| 652 | return o, nil |
| 653 | } |
| 654 | |
| 655 | // NewObject finds the Object at remote. If it can't be found |
| 656 | // it returns the error fs.ErrorObjectNotFound. |
no test coverage detected