// Return an Object from a path
//
//If it can't be found it returns the error ErrorObjectNotFound.
Return an Object from a path

If it can't be found it returns the error ErrorObjectNotFound.
// Return an Object from a path // // If it can ' t be found it returns the error ErrorObjectNotFound .
func (f *Fs) newObjectWithInfo(remote string, info *qs.KeyType) (fs.Object, error) {
	o := &Object{
		fs:     f,
		remote: remote,
	}
	if info != nil {
		if info.Size != nil {
			o.size = *info.Size
		}
		if info.Etag != nil {
			o.etag = qs.StringValue(info.Etag)
		}
		if info.Modified == nil {
			fs.Logf(o, "Failed to read last modified")
			o.lastModified = time.Now()
		} else {
			o.lastModified = timestampToTime(int64(*info.Modified))
		}
		if info.MimeType != nil {
			o.mimeType = qs.StringValue(info.MimeType)
		}
		if info.Encrypted != nil {
			o.encrypted = qs.BoolValue(info.Encrypted)
		}
	} else {
		err := o.readMetaData() 
		if err != nil {
			return nil, err
		}
	}
	return o, nil
}
func ( f * Fs ) newObjectWithInfo ( remote string , info * qs . KeyType ) ( fs . Object , error ) { o := & Object { fs : f , remote : remote , } if info != nil { if info . Size != nil { o . size = * info . Size } if info . Etag != nil { o . etag = qs . StringValue ( info . Etag ) } if info . Modified == nil { fs . Logf ( o , " " ) o . lastModified = time . Now ( ) } else { o . lastModified = timestampToTime ( int64 ( * info . Modified ) ) } if info . MimeType != nil { o . mimeType = qs . StringValue ( info . MimeType ) } if info . Encrypted != nil { o . encrypted = qs . BoolValue ( info . Encrypted ) } } else { err := o . readMetaData ( ) if err != nil { return nil , err } } return o , nil }
Return an Object from a path
Return an Object from a path
// Set info // reads info and meta, returning an error