Apply the namespace to the given path

@param namespace namespace (can be null)
@param path      path
@return adjusted path
354305
public static String fixForNamespace(String namespace, String path)
    {
        return fixForNamespace(namespace, path, false);
    }
1240525
public static @NotNull String mangleNamespaces(@NotNull String path) {
    if (!StringUtils.contains(path, NAMESPACE_SEPARATOR)) {
      return path;
    }
    Matcher matcher = NAMESPACE_PATTERN.matcher(path);
    StringBuffer sb = new StringBuffer();
    while (matcher.find()) {
      String replacement = MANGLED_NAMESPACE_PREFIX + matcher.group(1) + MANGLED_NAMESPACE_SUFFIX;
      matcher.appendReplacement(sb, replacement);
    }
    matcher.appendTail(sb);
    return sb.toString();
  }
160493
public static UsingPath dropIndex(String namespace, String keyspace, String indexName) {
        return new DefaultDropPath().drop(namespace, keyspace, indexName);
    }
488762
public B withConfigPath(String path) {
        assertNotNull(path, "path could not be null.");
        withConfigProperties(EmbedVaadinConfig.loadProperties(path));
        return self();
    }
1000441
public function registerNamespace($namespace, $paths)
    {
        if (false === isset($this->_namespaces[$namespace])) {
            $this->_namespaces[$namespace] = array();
        }

        $this->_namespaces[$namespace] = array_merge($this->_namespaces[$namespace], (array) $paths);

        return $this;
    }
523046
public function addCmsAppPath($path, $namespace = self::MAIN_NAMESPACE)
    {
        // invalidate the cache
        $this->cache = $this->errorCache = array();

        if (!is_dir($path)) {
            throw new \Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path));
        }

        $path = rtrim($path, '/\\');

        if (!isset($this->paths[$namespace])) {
            $this->paths[$namespace][] = $path;
        } else {
            $existAppPathKey = false;

            foreach ($this->paths[$namespace] as $key => $path2) {
                if (strpos($path2, 'app/Resources/')) {
                    $existAppPathKey = $key;
                }
            }

            if ($existAppPathKey === false) {
                array_unshift($this->paths[$namespace], $path);
            } else {
                $newPaths = [];

                foreach ($this->paths[$namespace] as $key => $path2) {
                    $newPaths[] = $path2;

                    if ($key == $existAppPathKey) {
                        $newPaths[] = $path;
                    }
                }

                $this->paths[$namespace] = $newPaths;
            }
        }
    }
1290865
protected function redirectUserPath(string $namespace, string $path, ?string $redirect = null): string
    {
        if (! empty($redirect)) {
            $path = $redirect;
        }

        $property = \sprintf('redirect%sPath', Str::ucfirst($namespace));

        return \property_exists($this, $property) ? $this->{$property} : $path;
    }
916486
public function loadAliasesFrom($path, $namespace, $key = 'aliases')
    {
        // Get the alias loader
        $loader = Loader::getInstance();

        // Prepare key for config line
        $key = ! is_null($key) ? '.' . $key : null;

        // Wrapped in a try catch because Finder squawks when there is no directory
        try{

            // Load the namespaced config files
            $files = Finder::create()->files()->name('*.php')->in($path);
            foreach($files as $file)
            {
                // Construct the config line where aliases are defined
                $filename = basename($file->getRealPath(), '.php');
                $line = $namespace . '::' . $filename . $key;

                // Load each of the aliases
                $aliases = config($line, []);
                foreach( $aliases as $alias => $class)
                {
                    $loader->alias($alias, $class);
                }
            }

        // Silently ignore Finder exceptions
        } catch( InvalidArgumentException $e){}
    }
702582
public function addPath($namespace, $path, $prepend = false) {
		if($namespace === null) {
			$namespace = '_';
		}
		if(!isset($this->paths[$namespace])) {
			$this->paths[$namespace] = [];
		}
		if($prepend) {
			array_unshift($this->paths[$namespace], $path);
		} else {
			array_push($this->paths[$namespace], $path);
		}
	}
467874
public T namespace(String prefix, String namespaceUri) {
        getXpathVariableExtractor().getNamespaces().put(prefix, namespaceUri);
        xmlMessageValidationContext.getNamespaces().put(prefix, namespaceUri);
        return self;
    }
448280
public static function namespace($key, $path){
        if(!array_key_exists($key, self::$namespaces))
            self::$namespaces[$key] = $path;
    }
103165
public function addPath($path, $namespace = null)
    {
        $key = (is_null($namespace)) ? $path : $namespace . '::' . $path;

        $this->fullQualifiedPathNameWithTemplatePath[$key] = new TemplatePath($path, $namespace);
    }
661271
public function addPath($path, $namespace = self::MAIN_NAMESPACE)
    {
        // invalidate the cache
        $this->cache = $this->errorCache = [];

        if (!is_dir($path)) {
            throw new LoaderException(sprintf('The "%s" directory does not exist.', $path));
        }

        $this->paths[$namespace][] = rtrim($path, '/\\');
    }
374195
public StringPath get(StringPath path) {
        StringPath newPath = getString(toString(path));
        return addMetadataOf(newPath, path);
    }
1262375
private function getBasePathForClass($name, $namespace, $path)
    {
        $namespace   = str_replace('\\', '/', $namespace);
        $search      = str_replace('\\', '/', $path);
        $destination = str_replace('/' . $namespace, '', $search, $c);

        if ($c !== 1) {
            throw new RuntimeException(sprintf('Can\'t find base path for "%s" (path: "%s", destination: "%s").', $name, $path, $destination));
        }

        return $destination;
    }
812035
public function addAnnotationNamespace($namespace, $path = null)
    {
        $this->namespaces[] = $namespace;

        return $this->registerAnnotationsPathWithRegistry(
            $path ?: $this->getPathFromNamespace($namespace)
        );
    }
262532
public static CuratorFramework useNamespaceAndEnsurePath(final CuratorFramework client, final String path) throws Exception {
		Preconditions.checkNotNull(client, "client must not be null");
		Preconditions.checkNotNull(path, "path must not be null");

		// Ensure that the checkpoints path exists
		client.newNamespaceAwareEnsurePath(path)
			.ensure(client.getZookeeperClient());

		// All operations will have the path as root
		return client.usingNamespace(generateZookeeperPath(client.getNamespace(), path));
	}