decodeMetaDataRaw sets the metadata from the data passed in Sets o.id o.modTime o.size o.sha1
(ID, SHA1 string, Size int64, UploadTimestamp api.Timestamp, Info map[string]string, mimeType string)
| 1750 | // o.size |
| 1751 | // o.sha1 |
| 1752 | func (o *Object) decodeMetaDataRaw(ID, SHA1 string, Size int64, UploadTimestamp api.Timestamp, Info map[string]string, mimeType string) (err error) { |
| 1753 | o.id = ID |
| 1754 | o.sha1 = SHA1 |
| 1755 | o.mimeType = mimeType |
| 1756 | // Read SHA1 from metadata if it exists and isn't set |
| 1757 | if o.sha1 == "" || o.sha1 == "none" { |
| 1758 | o.sha1 = Info[sha1Key] |
| 1759 | } |
| 1760 | o.sha1 = cleanSHA1(o.sha1) |
| 1761 | o.size = Size |
| 1762 | // Use the UploadTimestamp if can't get file info |
| 1763 | o.modTime = time.Time(UploadTimestamp) |
| 1764 | err = o.parseTimeString(Info[timeKey]) |
| 1765 | if err != nil { |
| 1766 | return err |
| 1767 | } |
| 1768 | return nil |
| 1769 | } |
| 1770 | |
| 1771 | // decodeMetaData sets the metadata in the object from an api.File |
| 1772 | // |
no test coverage detected