// readMetaData gets the metadata if it hasn't already been fetched
//
// it also sets the info
readMetaData gets the metadata if it hasn't already been fetched

it also sets the info
// readMetaData gets the metadata if it hasn ' t already been fetched // // it also sets the info
func (o *Object) readMetaData() (err error) {
	bucketInit, err := o.fs.svc.Bucket(o.fs.bucket, o.fs.zone)
	if err != nil {
		return err
	}
	key := o.fs.root + o.remote
	fs.Debugf(o, "Read metadata of key: %s", key)
	resp, err := bucketInit.HeadObject(key, &qs.HeadObjectInput{})
	if err != nil {
		fs.Debugf(o, "Read metadata failed, API Error: %v", err)
		if e, ok := err.(*qsErr.QingStorError); ok {
			if e.StatusCode == http.StatusNotFound {
				return fs.ErrorObjectNotFound
			}
		}
		return err
	}
	if resp.ContentLength != nil {
		o.size = *resp.ContentLength
	}
	if resp.ETag != nil {
		o.etag = qs.StringValue(resp.ETag)
	}
	if resp.LastModified == nil {
		fs.Logf(o, "Failed to read last modified from HEAD: %v", err)
		o.lastModified = time.Now()
	} else {
		o.lastModified = *resp.LastModified
	}
	if resp.ContentType != nil {
		o.mimeType = qs.StringValue(resp.ContentType)
	}
	if resp.XQSEncryptionCustomerAlgorithm != nil {
		o.algo = qs.StringValue(resp.XQSEncryptionCustomerAlgorithm)
		o.encrypted = true
	}
	return nil
}
func ( o * Object ) readMetaData ( ) ( err error ) { bucketInit , err := o . fs . svc . Bucket ( o . fs . bucket , o . fs . zone ) if err != nil { return err } key := o . fs . root + o . remote fs . Debugf ( o , " " , key ) resp , err := bucketInit . HeadObject ( key , & qs . HeadObjectInput { } ) if err != nil { fs . Debugf ( o , " " , err ) if e , ok := err . ( * qsErr . QingStorError ) ; ok { if e . StatusCode == http . StatusNotFound { return fs . ErrorObjectNotFound } } return err } if resp . ContentLength != nil { o . size = * resp . ContentLength } if resp . ETag != nil { o . etag = qs . StringValue ( resp . ETag ) } if resp . LastModified == nil { fs . Logf ( o , " " , err ) o . lastModified = time . Now ( ) } else { o . lastModified = * resp . LastModified } if resp . ContentType != nil { o . mimeType = qs . StringValue ( resp . ContentType ) } if resp . XQSEncryptionCustomerAlgorithm != nil { o . algo = qs . StringValue ( resp . XQSEncryptionCustomerAlgorithm ) o . encrypted = true } return nil }
readMetaData gets the metadata if it hasn't already been fetched
readMetaData gets the metadata if it hasn ' t already been fetched
// Ignore missing Content-Length assuming it is 0