MCPcopy Index your code
hub / github.com/rclone/rclone / newObjectWithInfo

Method newObjectWithInfo

backend/oracleobjectstorage/oracleobjectstorage.go:500–528  ·  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 *objectstorage.ObjectSummary)

Source from the content-addressed store, hash-verified

498// Return an Object from a path
499// If it can't be found it returns the error fs.ErrorObjectNotFound.
500func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *objectstorage.ObjectSummary) (fs.Object, error) {
501 o := &Object{
502 fs: f,
503 remote: remote,
504 }
505 if info != nil {
506 // Set info but not meta
507 if info.TimeModified == nil {
508 fs.Logf(o, "Failed to read last modified")
509 o.lastModified = time.Now()
510 } else {
511 o.lastModified = info.TimeModified.Time
512 }
513 if info.Md5 != nil {
514 md5, err := o.base64ToMd5(*info.Md5)
515 if err != nil {
516 o.md5 = md5
517 }
518 }
519 o.bytes = *info.Size
520 o.storageTier = storageTierMap[strings.ToLower(string(info.StorageTier))]
521 } else {
522 err := o.readMetaData(ctx) // reads info and headers, returning an error
523 if err != nil {
524 return nil, err
525 }
526 }
527 return o, nil
528}
529
530// NewObject finds the Object at remote. If it can't be found
531// it returns the error fs.ErrorObjectNotFound.

Callers 2

itemToDirEntryMethod · 0.95
NewObjectMethod · 0.95

Calls 3

base64ToMd5Method · 0.95
readMetaDataMethod · 0.95
LogfFunction · 0.92

Tested by

no test coverage detected