// URL implements storage.StorageReader
334058
func (stor *maas2Storage) URL(name string) (string, error) {
	name = stor.prefixWithPrivateNamespace(name)
	file, err := stor.maasController.GetFile(name)
	if err != nil {
		return "", errors.Trace(err)
	}
	return file.AnonymousURL(), nil
}
1043434
func (r *Request) URL() *URL {
	return NewURL(r.TLS != nil, r.Host+r.RequestURI)
}
882978
func (a *API) BuildURL(relpath string, args ...interface{}) string {
	if url, err := a.url.Parse(fmt.Sprintf(relpath, args...)); err == nil {
		return url.String()
	}

	return ""
}
1190114
func (b Base) URL(styles ...string) string {
	if b.Url != "" && len(styles) > 0 {
		ext := path.Ext(b.Url)
		return fmt.Sprintf("%v.%v%v", strings.TrimSuffix(b.Url, ext), styles[0], ext)
	}
	return b.Url
}
983130
func (formats *Formats) load(url string) error {
	ext := getExt(url)
	if loader, ok := Files.formats[ext]; ok {
		f, err := openFile(filepath.Join(formats.root, url))
		if err != nil {
			return fmt.Errorf("unable to open resource: %s", err)
		}
		defer f.Close()

		return loader.Load(url, f)
	}
	return fmt.Errorf("no `FileLoader` associated with this extension: %q in url %q", ext, url)
}
87334
func (loc *Location) URL() string {
	base, _ := url.Parse(loc.opts.SitemapsHost())

	for _, ref := range []string{
		loc.opts.sitemapsPath + "/", loc.Filename(),
	} {
		base, _ = base.Parse(ref)
	}

	return base.String()
}
788958
func (bow *Browser) Url() *url.URL {
	if bow.state.Response == nil {
		// there is a possibility that we issued a request, but for
		// whatever reason the request failed.
		if bow.state.Request != nil {
			return bow.state.Request.URL
		}
		return nil
	}

	return bow.state.Response.Request.URL
}
605935
func (q *Queue) AddURL(URL string) error {
	u, err := url.Parse(URL)
	if err != nil {
		return err
	}
	r := &colly.Request{
		URL:    u,
		Method: "GET",
	}
	d, err := r.Marshal()
	if err != nil {
		return err
	}
	return q.storage.AddRequest(d)
}
88190
func (r *Registry) url(pathTemplate string, args ...interface{}) string {
	pathSuffix := fmt.Sprintf(pathTemplate, args...)
	url := fmt.Sprintf("%s%s", r.URL, pathSuffix)
	return url
}
38166
func (ns *Namespace) URL(a interface{}) (template.URL, error) {
	s, err := cast.ToStringE(a)
	return template.URL(s), err
}
1080872
func (d Datastore) URL(ctx context.Context, dc *Datacenter, path string) (*url.URL, error) {
	return d.NewURL(path), nil
}
995646
func (b *Builder) URL(httpAttemptCount int, urls ...*url.URL) *Builder {
	for _, u := range urls {
		b.paths = append(b.paths, &URLVisitor{
			URL:              u,
			StreamVisitor:    NewStreamVisitor(nil, b.mapper, u.String(), b.schema),
			HttpAttemptCount: httpAttemptCount,
		})
	}
	return b
}
475049
func (otp *TOTP) URL(label string) string {
	return otp.OATH.URL(otp.Type(), label)
}
1352941
func (c *Charm) URL() *charm.URL {
	clone := *c.doc.URL
	return &clone
}
1046915
func (s *Subdomains) URL(purl string, args ...string) string {
	info := s.Get(args...)
	if info == nil {
		return purl
	}
	if len(info.Host) < 1 {
		if s.Default == info.Name {
			return purl
		}
		return `/` + info.Name + purl
	}
	if len(s.Protocol) < 1 {
		return `http://` + info.Host + purl
	}
	return s.Protocol + `://` + info.Host + purl
}
482772
func (post *UserPost) URL() *url.URL {
	return &url.URL{
		Host: Configuration.NERDZHost,
		Path: (post.Reference().(*User)).Username + "." + strconv.FormatUint(post.Pid, 10),
	}
}
930066
func (u clientURL) String() string {
	var buf bytes.Buffer
	// if fileSystem no translation needed, return as is.
	if u.Type == fileSystem {
		return u.Path
	}
	// if objectStorage convert from any non standard paths to a supported URL path style.
	if u.Type == objectStorage {
		buf.WriteString(u.Scheme)
		buf.WriteByte(':')
		buf.WriteString("//")
		if h := u.Host; h != "" {
			buf.WriteString(h)
		}
		switch runtime.GOOS {
		case "windows":
			if u.Path != "" && u.Path[0] != '\\' && u.Host != "" && u.Path[0] != '/' {
				buf.WriteByte('/')
			}
			buf.WriteString(strings.Replace(u.Path, "\\", "/", -1))
		default:
			if u.Path != "" && u.Path[0] != '/' && u.Host != "" {
				buf.WriteByte('/')
			}
			buf.WriteString(u.Path)
		}
	}
	return buf.String()
}