MCPcopy
hub / github.com/rclone/rclone / setMetaData

Method setMetaData

backend/webdav/webdav.go:1396–1410  ·  view source on GitHub ↗

setMetaData sets the metadata from info

(info *api.Prop)

Source from the content-addressed store, hash-verified

1394
1395// setMetaData sets the metadata from info
1396func (o *Object) setMetaData(info *api.Prop) (err error) {
1397 o.hasMetaData = true
1398 o.size = info.Size
1399 o.modTime = time.Time(info.Modified)
1400 if o.fs.hasOCMD5 || o.fs.hasOCSHA1 || o.fs.hasMESHA1 {
1401 hashes := info.Hashes()
1402 if o.fs.hasOCSHA1 || o.fs.hasMESHA1 {
1403 o.sha1 = hashes[hash.SHA1]
1404 }
1405 if o.fs.hasOCMD5 {
1406 o.md5 = hashes[hash.MD5]
1407 }
1408 }
1409 return nil
1410}
1411
1412// readMetaData gets the metadata if it hasn't already been fetched
1413//

Callers 2

newObjectWithInfoMethod · 0.95
readMetaDataMethod · 0.95

Calls 1

HashesMethod · 0.65

Tested by

no test coverage detected