MCPcopy
hub / github.com/rclone/rclone / newObjectWithInfo

Method newObjectWithInfo

backend/googlecloudstorage/googlecloudstorage.go:639–653  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

637//
638// If it can't be found it returns the error fs.ErrorObjectNotFound.
639func (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.

Callers 2

NewObjectMethod · 0.95
itemToDirEntryMethod · 0.95

Calls 2

setMetaDataMethod · 0.95
readMetaDataMethod · 0.95

Tested by

no test coverage detected