// Exists checks if a directory exists or not
500301
func (d *Dir) Exists(newDir string) bool {
	for _, dir := range d.Blacklist {
		if dir == newDir {
			return true
		}
	}

	return false
}
1176871
func (self *CachingBackend) Exists(collection string, id interface{}) bool {
	return self.backend.Exists(collection, id)
}
573064
func (s *MockStore) Exists(key string) (bool, error) {
	_, ok := s.db[key]
	return ok, nil
}
337826
func (c *ZkConn) Exists(ctx context.Context, path string) (exists bool, stat *zk.Stat, err error) {
	err = c.withRetry(ctx, func(conn *zk.Conn) error {
		exists, stat, err = conn.Exists(path)
		return err
	})
	return
}
443115
func (m *InMem) Exists(ctx context.Context, name string) bool {
	m.Lock()
	defer m.Unlock()

	_, found := m.data[name]
	return found
}
792577
func (daemon *Daemon) Exists(id string) bool {
	c, _ := daemon.GetContainer(id)
	return c != nil
}
104296
func (m *Multi) Exists(name string) (string, bool) {
	for _, loader := range m.loaders {
		if fileName, ok := loader.Exists(name); ok {
			return fileName, true
		}
	}
	return "", false
}
794282
func Exists(set []string, find string) bool {
	for _, s := range set {
		if s == find {
			return true
		}
	}
	return false
}
542104
func (s *Store) Exists(ctx context.Context, name string) bool {
	path := filepath.Join(s.path, filepath.Clean(name))
	out.Debug(ctx, "fs.Exists(%s) - %s", name, path)
	return fsutil.IsFile(path)
}
1004113
func (d *Driver) Exists(id string) bool {
	_, err := os.Stat(d.block(id))
	return err == nil
}
708174
func (s *Store) Exists(ctx context.Context, name string) bool {
	out.Debug(ctx, "consul.Exists(%s)", name)
	v, err := s.Get(ctx, name)
	if err == nil && v != nil {
		return true
	}
	return false
}
967458
func Exists(ctx context.Context, clt client.ImageAPIClient, image string) (bool, error) {
	_, err := InspectImage(ctx, clt, image)
	if err != nil {
		if client.IsErrNotFound(err) {
			return false, nil
		}
		return false, err
	}
	return true, nil
}
1371806
func (m *Manager) Exists(globalID string) bool {
	count, _ := m.collection.Find(bson.M{"globalid": globalID}).Count()

	return count == 1
}
406149
func (b *Bucket) Exists(path string) (exists bool, err error) {
	req := &request{
		method: "HEAD",
		bucket: b.Name,
		path:   path,
	}
	err = b.S3.prepare(req)
	if err != nil {
		return
	}
	for attempt := b.S3.AttemptStrategy.Start(); attempt.Next(); {
		resp, err := b.S3.run(context.Background(), req, nil)

		if shouldRetry(err) && attempt.HasNext() {
			continue
		}

		if err != nil {
			// We can treat a 403 or 404 as non existence
			if e, ok := err.(*Error); ok && (e.StatusCode == 403 || e.StatusCode == 404) {
				return false, nil
			}
			return false, err
		}

		if resp.StatusCode/100 == 2 {
			exists = true
		}
		return exists, err
	}
	return false, fmt.Errorf("S3 Currently Unreachable")
}
593163
func (l *httpFileSystemLoader) Exists(name string) (string, bool) {
	if l.fs == nil {
		return "", false
	}
	if f, err := l.Open(name); err == nil {
		f.Close()
		return name, true
	}
	return "", false
}
513075
func (cfs *cacheFSObjects) Exists(ctx context.Context, bucket, object string) bool {
	_, err := cfs.GetObjectInfo(ctx, bucket, object, ObjectOptions{})
	return err == nil
}
320979
func (b *BiMap) Exists(k interface{}) bool {
	b.s.RLock()
	defer b.s.RUnlock()
	_, ok := b.forward[k]
	return ok
}