// GetFileInfo - Returns file information for the given File wrapper.
// objectId - JavaScript object id of the node wrapper.
// Returns -  path -
489555
func (c *DOM) GetFileInfo(objectId string) (string, error) {
	var v DOMGetFileInfoParams
	v.ObjectId = objectId
	return c.GetFileInfoWithParams(&v)
}
1367550
func (c *Client) GetFileInfoByID(id string) (*FileInfo, error) {
	res, err := c.doRequest("b2_get_file_info", map[string]interface{}{
		"fileId": id,
	})
	if err != nil {
		return nil, err
	}
	defer drainAndClose(res.Body)
	var fi *fileInfoObj
	if err := json.NewDecoder(res.Body).Decode(&fi); err != nil {
		return nil, err
	}
	return fi.makeFileInfo(), nil
}
194956
func writeFileInfo(w io.Writer, file *fileInfo, r io.Reader) error {
	err := t.ExecuteTemplate(w, "FileInfo-Before", file)
	if err != nil {
		return err
	}
	sw := &stringWriter{Writer: w}
	_, err = io.Copy(sw, r)
	if err != nil {
		return err
	}
	err = t.ExecuteTemplate(w, "FileInfo-After", file)
	return err
}
342331
func (c *HeapProfiler) GetHeapObjectId(objectId string) (string, error) {
	var v HeapProfilerGetHeapObjectIdParams
	v.ObjectId = objectId
	return c.GetHeapObjectIdWithParams(&v)
}
325444
func GetAuthInfo(indexServer string) (string, string, error) {
	// official docker registry
	if indexServer == defaultIndexURL {
		indexServer = defaultIndexURLAuth
	}
	dockerCfgPath := path.Join(getHomeDir(), ".docker", dockercfgFileName)
	if _, err := os.Stat(dockerCfgPath); err == nil {
		j, err := ioutil.ReadFile(dockerCfgPath)
		if err != nil {
			return "", "", err
		}
		var dockerAuth types.DockerConfigFile
		if err := json.Unmarshal(j, &dockerAuth); err != nil {
			return "", "", err
		}
		// try the normal case
		if c, ok := dockerAuth.AuthConfigs[indexServer]; ok {
			return decodeDockerAuth(c.Auth)
		}
	} else if os.IsNotExist(err) {
		oldDockerCfgPath := path.Join(getHomeDir(), dockercfgFileNameOld)
		if _, err := os.Stat(oldDockerCfgPath); err != nil {
			return "", "", nil //missing file is not an error
		}
		j, err := ioutil.ReadFile(oldDockerCfgPath)
		if err != nil {
			return "", "", err
		}
		var dockerAuthOld map[string]types.DockerAuthConfigOld
		if err := json.Unmarshal(j, &dockerAuthOld); err != nil {
			return "", "", err
		}
		if c, ok := dockerAuthOld[indexServer]; ok {
			return decodeDockerAuth(c.Auth)
		}
	} else {
		// if file is there but we can't stat it for any reason other
		// than it doesn't exist then stop
		return "", "", fmt.Errorf("%s - %v", dockerCfgPath, err)
	}
	return "", "", nil
}
1141085
func GetDocument() *js.Object {
	win := GetWindow()
	if win == nil || win == js.Undefined {
		return nil
	}
	return win.Get("document")
}
1125359
func GetFileInfos(importPaths []string, protos []string, protocCommand string) (info map[string]*FileInfo, err error) {
	if len(importPaths) == 0 {
		return nil, fmt.Errorf("GetFileInfos: empty importPaths")
	}
	if len(protos) == 0 {
		return nil, fmt.Errorf("GetFileInfos: empty protos")
	}
	info = map[string]*FileInfo{}

	var dir string
	dir, err = ioutil.TempDir("", "filedescriptors")
	if err != nil {
		return nil, err
	}
	defer func() {
		if err2 := os.RemoveAll(dir); err != nil && err2 != nil {
			err = err2
		}
	}()

	descriptorFilename := filepath.Join(dir, "all.pb")

	args := []string{}
	for _, importPath := range importPaths {
		args = append(args, "-I", importPath)
	}
	args = append(args, "--descriptor_set_out="+descriptorFilename)

	args = append(args, "--include_imports")

	for _, proto := range protos {
		args = append(args, proto)
	}

	fmt.Println("Collecting filedescriptors...")
	cmd := exec.Command(protocCommand, args...)
	out, err := cmd.CombinedOutput()
	if err != nil {
		cmdline := fmt.Sprintf("%s %s\n", protocCommand, strings.Join(args, " "))
		return nil, fmt.Errorf("error running %v\n%v\nOutput:\n======\n%s======\n", cmdline, err, out)
	}
	descriptorSetBytes, err := ioutil.ReadFile(descriptorFilename)
	if err != nil {
		return nil, err
	}

	descriptorSet := &descriptor.FileDescriptorSet{}
	err = proto.Unmarshal(descriptorSetBytes, descriptorSet)
	if err != nil {
		return nil, err
	}

	for _, fd := range descriptorSet.File {
		fi := &FileInfo{
			Name:    fd.GetName(),
			Package: fd.GetPackage(),
		}
		for _, dep := range fd.Dependency {
			fi.Deps = append(fi.Deps, dep)
		}
		fi.GoPackage = fd.Options.GetGoPackage()
		info[fi.Name] = fi
	}

	return info, nil
}
1151489
func (d *Dir) GetByPath(nodePath string) (os.FileInfo, error) {
	var currentNode os.FileInfo = d
	if nodePath == "." || nodePath == "./" {
		return currentNode, nil
	}
	pathNodes := strings.Split(path.Clean(nodePath), "/")
	for _, nodeName := range pathNodes {
		if currentNode.IsDir() != true {
			return nil, fmt.Errorf("Node by name " + currentNode.Name() + " must be dir to get sub node (path " + nodePath + " )")
		}
		var dir = currentNode.(*Dir)
		newNode, err := dir.GetNode(nodeName)
		if err != nil {
			return nil, err
		}
		currentNode = newNode
	}
	return currentNode, nil
}
584255
func (a *Client) GetFilesFileidentifier(params *GetFilesFileidentifierParams, authInfo runtime.ClientAuthInfoWriter) (*GetFilesFileidentifierOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetFilesFileidentifierParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetFilesFileidentifier",
		Method:             "GET",
		PathPattern:        "/files/{fileidentifier}",
		ProducesMediaTypes: []string{"application/json", "application/x-gzip"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetFilesFileidentifierReader{formats: a.formats},
		AuthInfo:           authInfo,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetFilesFileidentifierOK), nil
}
935314
func (*EmptyFolder) GetFileInformation(context.Context, *dokan.FileInfo) (a *dokan.Stat, err error) {
	return defaultDirectoryInformation()
}
1306321
func (doc *Document) GetDocument() ([]byte, error) {
	if doc.Id != "" {
		return doc.getDocFromId()
	}

	return nil, errors.New("An id required to search for the document.")
}
659485
func (c *CachedNodeInfo) GetNodeInfo(id string) (*v1.Node, error) {
	node, err := c.Get(id)

	if apierrors.IsNotFound(err) {
		return nil, err
	}

	if err != nil {
		return nil, fmt.Errorf("error retrieving node '%v' from cache: %v", id, err)
	}

	return node, nil
}
24491
func (m *UnpartitionedMemoryIdx) GetPath(orgId uint32, path string) []idx.Archive {
	m.RLock()
	defer m.RUnlock()
	tree, ok := m.tree[orgId]
	if !ok {
		return nil
	}
	node := tree.Items[path]
	if node == nil {
		return nil
	}
	archives := make([]idx.Archive, len(node.Defs))
	for i, def := range node.Defs {
		archive := m.defById[def]
		archives[i] = *archive
	}
	return archives
}
343851
func (fsh *Handler) getFilesInPath(files []string, path string) error {
	pathInfo, err := os.Stat(path)
	if err != nil {
		return errors.Errorf("failed to read path %s: %v", path, err)
	}
	if pathInfo.IsDir() {
		pathList, err := ioutil.ReadDir(path)
		if err != nil {
			return errors.Errorf("failed to read directory %s: %v", path, err)
		}
		for _, nested := range pathList {
			// Recursive call to process all the tree
			if err := fsh.getFilesInPath(files, path+nested.Name()); err != nil {
				return err
			}
		}
	}
	files = append(files, path)

	return nil
}
642412
func getDiskInfo(diskPath string) (di disk.Info, err error) {
	if err = checkPathLength(diskPath); err == nil {
		di, err = disk.GetInfo(diskPath)
	}

	if os.IsNotExist(err) {
		err = errDiskNotFound
	}

	return di, err
}
362973
func (s *stringFile) GetFileInformation(ctx context.Context, fi *dokan.FileInfo) (*dokan.Stat, error) {
	a, err := defaultFileInformation()
	if err != nil {
		return nil, err
	}
	a.FileAttributes |= dokan.FileAttributeReadonly
	a.FileSize = int64(len(s.data))
	t := time.Now()
	a.LastWrite = t
	a.LastAccess = t
	a.Creation = t
	return a, nil
}
216509
func (fs *FSObjects) getUploadIDDir(bucket, object, uploadID string) string {
	return pathJoin(fs.fsPath, minioMetaMultipartBucket, getSHA256Hash([]byte(pathJoin(bucket, object))), uploadID)
}