Returns the namespace for a given path or null if the path isn't found

@param path the path
@return the related namespace
554841
public Namespace getNamespaceForPath(String path) {
		for (Namespace nmspc : properties.values()) {
			if (nmspc.has(path)) {
				return nmspc;
			}
		}
		
		return null;
	}
1331096
@Nullable
  public static String getFilename(@Nullable final String path) {
    if (path == null) {
      return null;
    }

    final int separatorIndex = path.lastIndexOf(StringUtils.FOLDER_SEPARATOR);
    return separatorIndex != -1 ? path.substring(separatorIndex + 1) : path;
  }
558143
static String[] getPathNames(String path) {
    if (path == null || !path.startsWith(Path.SEPARATOR)) {
      return null;
    }
    return StringUtils.split(path, Path.SEPARATOR_CHAR);
  }
887714
private function lookupNamespace(string $path)
    {
        $content = file_get_contents($path);

        preg_match(
            '#' .
            preg_quote('namespace') .
            '(.+?)' .
            preg_quote(';') .
            '#s',
            $content,
            $matchs
        );

        unset($content);

        return isset($matchs[1]) ? trim($matchs[1]): false;
    }
107493
private Xml getNodeDefault(String... path)
    {
        Xml node = root;
        for (final String element : path)
        {
            if (!node.hasChild(element))
            {
                return null;
            }
            node = node.getChild(element);
        }
        return node;
    }
79303
public static String fixForNamespace(String namespace, String path, boolean isSequential)
    {
        // Child path must be valid in and of itself.
        PathUtils.validatePath(path, isSequential);

        if ( namespace != null )
        {
            return makePath(namespace, path);
        }
        return path;
    }
1183132
public static String resolve(String path) {
        if (path == null) {
            return null;
        }
        if (path.startsWith("~" + File.separator)) {
            return SystemUtil.getUserHome() + path.substring(1);
        }
        return path;
    }
448280
public static function namespace($key, $path){
        if(!array_key_exists($key, self::$namespaces))
            self::$namespaces[$key] = $path;
    }
1150279
public static String getUrl(String path) {
        if (path == null) {
            return path;
        }

        ServletContext sc = ExecutionContext.getSession().getServletContext();

        if (path.startsWith("jar:")) {
            int i = path.indexOf("!");
            path = i < 0 ? path : path.substring(++i);
        }

        path = sc.getContextPath() + path;
        return path;
    }
593534
public static String getFilenameExtension(String path) {
        if (path == null) {
            return null;
        }
        int extIndex = path.lastIndexOf(".");
        if (extIndex == -1) {
            return null;
        }
        return path.substring(extIndex + 1);
    }
176000
public static String getNamespace(JsonNode node) {
		JsonNode nodeNs = obj(node).get(ID_NAMESPACE);
		return (nodeNs != null) ? nodeNs.asText() : null;
	}
1269603
@Override
   public String getTrimmedPath(String path)
   {
      if (path == null)
      {
         return "/";
      }
      if (!path.startsWith("/"))
      {
         try
         {
            path = new URL(path).getPath();
         }
         catch (MalformedURLException ex)
         {
            // ignore
            Logger.getLogger(JBossWSDestinationRegistryImpl.class).trace(ex);
         }
         if (!path.startsWith("/")) {
            path = "/" + path;
         }
      }
      return path;
   }
41251
public static function getNamespace(string $path) : string
    {
        $source = file_get_contents($path);

        if($source === false) {
            add_action( 'admin_notices',function() use($path) {
                $malfunctionalPlugin = array_pop(get_plugins( "/" . explode( '/', plugin_basename( $path ))[0]));
                printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr('notice notice-error'), esc_html("ERROR: Could not find module definition (file) in " . $malfunctionalPlugin['Name']));
            });
        }

        $tokens = token_get_all($source);
        $count = count($tokens);
        $i = 0;
        $namespace = '';
        $namespaceFound = false;

        while ($i < $count) {
            $token = $tokens[$i];

            if (is_array($token) && $token[0] === T_NAMESPACE) {
                // Found namespace declaration
                while (++$i < $count) {
                    if ($tokens[$i] === ';') {
                        $namespaceFound = true;
                        $namespace = trim($namespace);
                        break;
                    }

                    $namespace .= is_array($tokens[$i]) ? $tokens[$i][1] : $tokens[$i];
                }

                break;
            }

            $i++;
        }

        if (!$namespaceFound) {
            return '';
        }

        return $namespace;
    }
1119946
public ResolvedRequest withPath( String path ) {
        assert repositoryName != null;
        assert workspaceName != null;
        return new ResolvedRequest(request, repositoryName, workspaceName, path);
    }
490505
function Namespace(path, hex) {
  this.hex = !!hex
  this.keyEncoding = hex ? 'utf8' : 'binary'

  this.path = path
  this.buffer = bytewise.encode(path)
  this.prehooks = []
  this.posthooks = []
}
10822
public ConfigPath findByPath(final String path) {
        return paths.stream()
                .filter(it -> it.getPath().equalsIgnoreCase(path))
                .findFirst()
                .orElse(null);
    }
301692
protected function getNamespace($path)
    {
        return str_replace(" ", "", str_replace("/", "\\", ucwords(str_replace(
            '-',
            ' ',
            str_replace('/ ', '/', ucwords(str_replace('/', '/ ', $path)))
        ))));
    }