// SetImportPath sets the ImportPath field's value.
509317
func (s *DataRepositoryConfiguration) SetImportPath(v string) *DataRepositoryConfiguration {
	s.ImportPath = &v
	return s
}
557449
func (s *LocalVolumeResourceData) SetSourcePath(v string) *LocalVolumeResourceData {
	s.SourcePath = &v
	return s
}
269529
func (s *CreateRoleInput) SetPath(v string) *CreateRoleInput {
	s.Path = &v
	return s
}
856592
func (s *PatchOperation) SetPath(v string) *PatchOperation {
	s.Path = &v
	return s
}
531079
func setApplicationPath(c *model.CommandConfig) (err error) {

	// revel/revel#1014 validate relative path, we cannot use built-in functions
	// since Go import path is valid relative path too.
	// so check basic part of the path, which is "."
	if filepath.IsAbs(c.ImportPath) || strings.HasPrefix(c.ImportPath, ".") {
		utils.Logger.Fatalf("Abort: '%s' looks like a directory.  Please provide a Go import path instead.",
			c.ImportPath)
	}

	// If we are running a vendored version of Revel we do not need to check for it.
	if !c.New.Vendored {
		_, err = build.Import(model.RevelImportPath, "", build.FindOnly)
		if err != nil {
			//// Go get the revel project
			err = c.PackageResolver(model.RevelImportPath)
			if err != nil {
				return utils.NewBuildIfError(err, "Failed to fetch revel "+model.RevelImportPath)
			}
		}
	}

	c.AppName = filepath.Base(c.AppPath)

	return nil
}
305451
func (c *CommandConfig) UpdateImportPath() error {
	var importPath string
	required := true
	switch c.Index {
	case NEW:
		importPath = c.New.ImportPath
	case RUN:
		importPath = c.Run.ImportPath
	case BUILD:
		importPath = c.Build.ImportPath
	case PACKAGE:
		importPath = c.Package.ImportPath
	case CLEAN:
		importPath = c.Clean.ImportPath
	case TEST:
		importPath = c.Test.ImportPath
	case VERSION:
		importPath = c.Version.ImportPath
		required = false
	}

	if len(importPath) == 0 || filepath.IsAbs(importPath) || importPath[0] == '.' {
		utils.Logger.Info("Import path is absolute or not specified", "path", importPath)
		// Try to determine the import path from the GO paths and the command line
		currentPath, err := os.Getwd()
		if len(importPath) > 0 {
			if importPath[0] == '.' {
				// For a relative path
				importPath = filepath.Join(currentPath, importPath)
			}
			// For an absolute path
			currentPath, _ = filepath.Abs(importPath)
		}

		if err == nil {
			for _, path := range strings.Split(build.Default.GOPATH, string(filepath.ListSeparator)) {
				utils.Logger.Infof("Checking import path %s with %s", currentPath, path)
				if strings.HasPrefix(currentPath, path) && len(currentPath) > len(path)+1 {
					importPath = currentPath[len(path)+1:]
					// Remove the source from the path if it is there
					if len(importPath) > 4 && strings.ToLower(importPath[0:4]) == "src/" {
						importPath = importPath[4:]
					} else if importPath == "src" {
						if c.Index != VERSION {
							return fmt.Errorf("Invlaid import path, working dir is in GOPATH root")
						}
						importPath = ""
					}
					utils.Logger.Info("Updated import path", "path", importPath)
				}
			}
		}
	}

	c.ImportPath = importPath
	utils.Logger.Info("Returned import path", "path", importPath, "buildpath", build.Default.GOPATH)
	if required && c.Index != NEW {
		if err := c.SetVersions(); err != nil {
			utils.Logger.Panic("Failed to fetch revel versions", "error", err)
		}
		if err:=c.FrameworkVersion.CompatibleFramework(c);err!=nil {
			utils.Logger.Fatal("Compatibility Error", "message", err,
				"Revel framework version", c.FrameworkVersion.String(), "Revel tool version", c.CommandVersion.String())
		}
		utils.Logger.Info("Revel versions", "revel-tool", c.CommandVersion.String(), "Revel Framework", c.FrameworkVersion.String())
	}
	if !required {
		return nil
	}
	if len(importPath) == 0  {
		return fmt.Errorf("Unable to determine import path from : %s", importPath)
	}
	return nil
}
1240758
func (s *CancelResizeOutput) SetImportTablesNotStarted(v []*string) *CancelResizeOutput {
	s.ImportTablesNotStarted = v
	return s
}
1242851
func NormalizeImportPath(path string) string {
	chunks := strings.Split(path, "/vendor/")
	return chunks[len(chunks)-1]
}
537577
func (s *GetParametersForImportOutput) SetImportToken(v []byte) *GetParametersForImportOutput {
	s.ImportToken = v
	return s
}
709773
func (s *NFSFileShareInfo) SetPath(v string) *NFSFileShareInfo {
	s.Path = &v
	return s
}
274745
func (s *Tmpfs) SetContainerPath(v string) *Tmpfs {
	s.ContainerPath = &v
	return s
}
208154
func (s *HostVolumeProperties) SetSourcePath(v string) *HostVolumeProperties {
	s.SourcePath = &v
	return s
}
793210
func (s *CatalogImportStatus) SetImportTime(v time.Time) *CatalogImportStatus {
	s.ImportTime = &v
	return s
}
1160549
func (s *MappingEntry) SetSourcePath(v string) *MappingEntry {
	s.SourcePath = &v
	return s
}
354480
func (s *CancelResizeOutput) SetImportTablesInProgress(v []*string) *CancelResizeOutput {
	s.ImportTablesInProgress = v
	return s
}
774078
func (s *PolicyToPath) SetPath(v string) *PolicyToPath {
	s.Path = &v
	return s
}
190718
func ResolveImportPath(importPath string) (string, error) {
	if packaged {
		return filepath.Join(SourcePath, importPath), nil
	}

	modPkg, err := build.Import(importPath, RevelPath, build.FindOnly)
	if err != nil {
		return "", err
	}
	return modPkg.Dir, nil
}