Initialize paths.
@param {String} rootPath Root path inside the project
334286
function initMembers(rootPath) {

    this._rootPath = rootPath;
    ShellJS.mkdir(this._rootPath);

    this._appPath = this._rootPath + Path.sep + "app";
    ShellJS.mkdir(this._appPath);

    this._logPath = Path.join(OS.tmpdir(), "crosswalk-app-tools-" + this._packageId);
    ShellJS.mkdir(this._logPath);

    // Packages end up in working dir
    this._pkgPath = process.cwd();

    this._prjPath = this._rootPath + Path.sep + "prj";
    ShellJS.mkdir(this._prjPath);
}
1326653
private void initBaseTemplatePath(ServletContext servletContext) {
		if (engine.getSourceFactory() instanceof ClassPathSourceFactory) {
			// do nothing
		} else {
			if (StrKit.isBlank(engine.getBaseTemplatePath())) {
				String path = servletContext.getRealPath("/");
				engine.setBaseTemplatePath(path);
			}
		}
	}
459299
function init(options = {}, handlebars) {
  const opts = deepExtend({}, defaults, options);
  normalizePaths(opts);
  opts.handlebars = handlebars || Handlebars.create();
  return Promise.resolve(opts);
}
1041825
function initPaths (args) {
    // set path where controller is mounted
    this.path = typeof args.path === 'string' ? args.path : ''
    // create paths if not already defined
    if (!this.paths) {
        this.paths = {}
    }
    // if paths is false then do not create any paths
    if (args.paths === false) {
        return
    }
    // get paths object
    var paths = requireValidOptionalObject(args.paths)
    // configure default paths and create paths from args
    _.each(args.paths, (methods, path) => {
        // if value is false then delete all default controllers for path
        if (methods === false) {
            delete this.paths[path]
            return
        }
        // iterate over methods for path
        _.each(methods, (spec, method) => {
            // if spec is false the delete any default controller for method
            if (spec === false) {
                // if path does not exist do nothing
                if (!this.paths[path]) {
                    return
                }
                // delete all entries for method
                delete this.paths[path][method]
                return
            }
            // if path does not exist create
            if (!this.paths[path]) {
                this.paths[path] = {}
            }
            // if methods does not exist create
            if (!this.paths[path][method]) {
                this.paths[path][method] = []
            }
            // args value is list of controllers for different roles
            if (Array.isArray(spec)) {
                // either add each spec or merge to existing spec
                _.each(spec, spec => {
                    // default role to all
                    if (!spec.role) {
                        spec.role = 'all'
                    }
                    // get existing controller if defined
                    var controller = this.getController(method, path, spec.role)
                    // if controller exists then merge config
                    if (controller) {
                        _.merge(controller, spec)
                    }
                    // otherwise add new controller spec
                    else {
                        this.paths[path][method].push(spec)
                    }
                })
            }
            // if spec is an object then either apply arguments to existing
            // default controller or create new controller
            else if (spec && typeof spec === 'object') {
                // default role to all
                if (!spec.role) {
                    spec.role = 'all'
                }
                // get existing controller if defined
                var controller = this.getController(method, path, spec.role)
                // if controller exists then merge config
                if (controller) {
                    _.merge(controller, spec)
                }
                // otherwise add new controller spec
                else {
                    this.paths[path][method].push(spec)
                }
            }
            // error
            else {
                throw new Error('invalid controller '+spec+' at '+path+' '+method)
            }
        })
    })
    // iterate over paths validating spec and creating methods
    _.each(this.paths, (methods, path) => {
        // iterate over (http) methods
        _.each(methods, (specs, httpMethod) => {
            // require supported http method
            assert.ok(httpMethods[httpMethod], 'invalid http method '+httpMethod+' for '+path)
            // iterate specs for different roles
            _.each(specs, spec => {
                // if spec is GET and has a template but no method
                // then do not require method
                if (spec.template && !spec.after && !spec.before && !spec.method) {
                    return
                }
                // if function is passed then construct spec
                if (typeof spec === 'function') {
                    spec = {method: spec}
                }
                // create default method if method not defined
                if (!spec.method) {
                    spec.method = function (args) {return args}
                }
                // create method name
                if (!spec.methodName) {
                    // get method name from function
                    var matches = spec.method.toString().match(/function\s*([^\s^\)]+)\s*\(/)
                    // use function name
                    if (matches && matches[1].length) {
                        spec.methodName = matches[1]
                    }
                    // use path and method for method name
                    else {
                        // remove non-word chars
                        path = path.replace(/\W/, '')
                        // set method name as methodPath
                        spec.methodName = httpMethod+ucfirst(path)
                    }
                }
                // if method is already immutable then leave as is so that the same
                // spec can be shared between routes
                if (spec.method.meta) {
                    return
                }
                // get method signature from module and method name
                var methodSignature = this.moduleName+'.'+spec.methodName
                // create immutable method
                spec.method = immutable.method(methodSignature, spec.method)
                // if there are before functions add
                if (spec.before) {
                    var beforeMethodName = spec.methodName+'Before'
                    // create immutable method
                    spec.before = immutable.method(this.moduleName+'.'+beforeMethodName, spec.before)
                    // bind before method
                    immutable.before(methodSignature, spec.before)
                }
                // if there are after functions add
                if (spec.after) {
                    var afterMethodName = spec.methodName+'After'
                    // create immutable method
                    spec.after = immutable.method(this.moduleName+'.'+afterMethodName, spec.after)
                    // find after method
                    immutable.after(methodSignature, spec.after)
                }
            })
        })
    })
}
344158
function(root, path)
	{
		var parent = root;
		
		if (path != null)
		{
			var tokens = path.split(mxCellPath.PATH_SEPARATOR);
			
			for (var i=0; i<tokens.length; i++)
			{
				parent = parent.getChildAt(parseInt(tokens[i]));
			}
		}
		
		return parent;
	}
766936
private void initMapping(String attributePath, String aliasPath)
    {
        Iterator aliasSegmentItr = pathToSegments(aliasPath).iterator();
        String currPath = "";
        String separator = "";
        while (aliasSegmentItr.hasNext())
        {
            currPath = currPath + separator + (String) aliasSegmentItr.next();
            int beginIndex = attributePath.indexOf(currPath);
            if (beginIndex == -1)
            {
                break;
            }
            int endIndex = beginIndex + currPath.length();
            m_mapping.put(attributePath.substring(0, endIndex), m_name);
            separator = ".";
        }
    }
993117
function( root ) { //jshint ignore:line
        for ( var i = 0; i < preInitPlugins.length; i++ ) {
            var thisLevel = preInitPlugins[ i ];
            if ( thisLevel !== undefined ) {
                for ( var j = 0; j < thisLevel.length; j++ ) {
                    thisLevel[ j ]( root );
                }
            }
        }
    }
198439
function Project(path) {
  path = path || PWD;
  this.root = '';
  this.storage = '';
  this.ignore = [];
  this.resolvePaths(path);
}
561724
function(path) {
      var code = require('fs').readFileSync(path);
      var context = vm.createContext(initContext);
      context.flow = _conn.flow;
      vm.runInContext(code, context);
      for (var key in context) {
        if (!initContext[key]) {
          global[key] = context[key];
        }
      }
    }
1273679
public void init(Node segref, String path, char predelim0, char predelim1, StringBuffer res, Document document,
                     HashMap<String, String> predefs, HashMap<String, String> valids) {
        super.init(segref, path, predelim0, predelim1, res, document, predefs, valids);
    }
804156
public static void setInitFilePath(String filePath) {
		filePath=getPropertiesFilePath(filePath);
		
		if (staticFileProperties == null) {
			staticFileProperties=new FileProperties(filePath);
		} else {
			staticFileProperties.setInitFilePath(filePath);
		}
	}
579379
static void initPaths() {
		if (config != null && config.getPaths() != null) {
			for (PathChain pathChain : config.getPaths()) {
				pathChain.validate(configName + " config"); // raises exception on misconfiguration
				if(pathChain.getPath() == null) {
					addSourceChain(pathChain);
				} else {
					addPathChain(pathChain);
				}
			}
		}
	}
1155837
public function init(): void
    {
        if ($this->sourcePath !== null) {
            $this->sourcePath = $this->findPath($this->sourcePath);
        }
        if ($this->basePath !== null) {
            $this->basePath = $this->findPath($this->basePath);
        }
        if ($this->baseUrl !== null) {
            $this->baseUrl = rtrim(Yii::getAlias($this->baseUrl), '/');
        }
    }
1312221
void init(String path) {
        this.path = checkHasText(path, "path cannot be null or empty");
        this.index = 0;
        this.offset = 0;
        this.nextSplit = StringUtil.indexOf(path, '.', 0);
        this.token = null;
        if (nextSplit == 0) {
            throw new IllegalArgumentException("The path cannot begin with a dot: " + path);
        }
    }
206510
public void initialize() throws IOException  {
    rootEntry.refresh(rootEntry.getPath());
    final FileStatusEntry[] children = doListPathsEntry(rootEntry.getPath(), rootEntry);
    rootEntry.setChildren(children);
  }
594925
protected function _initPaths()
    {
        $path = Path::getInstance();
        $path->setRoot(ROOT);

        //  Setup all webroot paths
        $path->set('webroot', Configure::read('App.wwwRoot'));
        foreach ((array) Plugin::loaded() as $name) {
            $plgPath = Plugin::path($name) . '/' . Configure::read('App.webroot') . '/';
            $path->set('webroot', FS::clean($plgPath), Path::MOD_APPEND);
        }

        //  Setup applicatiojn paths
        $paths = Configure::read('App.paths');
        foreach ($paths as $alias => $_paths) {
            $path->set($alias, $_paths);
        }

        return $path;
    }
594347
private static Path qualified(Path rootPath, Path path) {
        URI rootUri = rootPath.toUri();
        return path.makeQualified(rootUri, new Path(rootUri.getPath()));
    }