Gets the document for a given file path.

@param path The file path.
@return The contained document, or null if not found.
184011
public boolean containsProgramPath(String path) {
        return registryMap.containsKey(path) && registryMap.get(path).getProgram() != null;
    }
483324
@Override
    public FileStore getFileStore(final Path path) throws IOException {
        final FileStore fileStore = path.getFileSystem().getFileStores().iterator().next();
        return fileStore;
    }
821388
public String getLabel(String path) {
        if (labelGenerator != null) {
            return labelGenerator.getLabelForPath(path).toString();
        }
        if (fileNameMap != null && fileNameMap.containsKey(path))
            return fileNameMap.get(path);
        return (new File(path)).getParentFile().getName();
    }
906248
@Override
    public InputStream getResourceAsStream(final String path) {
        final ResourceList resourceList = scanResult.getResourcesWithPath(path);
        if (resourceList == null || resourceList.isEmpty()) {
            return super.getResourceAsStream(path);
        } else {
            try {
                return resourceList.get(0).open();
            } catch (final IOException e) {
                return null;
            }
        }
    }
894724
public Manifest findByPath(String path) {
        for (Manifest manifest : this) {
            String mpath = ((ManifestEx) manifest).path;

            if (path.startsWith(mpath)) {
                return manifest;
            }
        }

        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;
  }
682889
public static Path asPath(String path) {
    URI uri = URI.create(path);
    return uri.getScheme() == null ? Paths.get(path) : asPath(uri);
  }
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);
    }
834210
public Entry getMetadata(String path, int fileLimit) {
        return getMetadata(path, fileLimit, null, true);
    }
360549
public Set<String> getProperties(String path) {
        Props props = pathMap.get(path);
        return props == null ? null : props.getProperties();
    }
172202
@Override
	public Set<InputStream> getResourcesAsStream(final String path) throws IOException
	{
		// For local paths, try to resolve the path relative to the folder of the master file
		// N.B. Assumes paths are sensible, not .//someFile.xml
		if (path.startsWith("./"))
		{
			final Set<InputStream> streams = inner.getResourcesAsStream(folder + path.substring(2));

			if (streams != null && !streams.isEmpty())
				return streams;
		}

		return inner.getResourcesAsStream(path);
	}
344532
public static ObjectReference getObjectRefByPath(final String path) {
        if (path == null) {
            return null;
        }
        return new ObjectReference().withSelector(path);
    }
1006147
public Map<String, String> parseXmlConfiguration(final String path) {
    File xmlFile;
    xmlFile = new File(path);
    if (!xmlFile.exists()) {
      System.err.format("File %s does not exist.", path);
      return null;
    }
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder;
    try {
      docBuilder = docBuilderFactory.newDocumentBuilder();
    } catch (ParserConfigurationException e) {
      System.err.format("Failed to create instance of DocumentBuilder for file: %s. %s. %n",
          path, e.getMessage());
      return null;
    }
    Document doc;
    try {
      doc = docBuilder.parse(xmlFile);
    } catch (IOException e) {
      System.err.format("An I/O error occured reading file %s. %s.%n", path, e.getMessage());
      return null;
    } catch (SAXException e) {
      System.err.format("A parsing error occured parsing file %s. %s.%n", path, e.getMessage());
      return null;
    }
    // Optional, but recommended.
    // Refer to http://stackoverflow.com/questions/13786607/normalization-in-dom-parsing-with-java-how-does-it-work
    doc.getDocumentElement().normalize();
    Map<String, String> ret = new HashMap<>();
    NodeList propNodeList = doc.getElementsByTagName("property");
    for (int i = 0; i < propNodeList.getLength(); i++) {
      Node propNode = propNodeList.item(i);
      if (propNode.getNodeType() == Node.ELEMENT_NODE) {
        Element element = (Element) propNode;
        ret.put(element.getElementsByTagName("name").item(0).getTextContent(),
            element.getElementsByTagName("value").item(0).getTextContent());
      }
    }
    return ret;
  }
500992
private DocumentPath getDocumentPath(List<PathSegment> params) {
    if (params.isEmpty()) {
      return DocumentPath.ROOT;
    } else {
      return DocumentPath.from(params.stream().map(PathSegment::getPath).collect(Collectors.toList()));
    }
  }
159095
public static VirtualFile getChild(String path) {
        if (path == null) {
            throw VFSMessages.MESSAGES.nullArgument("path");
        }
        return rootVirtualFile.getChild(path);
    }
68764
public static Stream<Path> getChildrenPathStream(Path path) {
		return Optional.ofNullable(path.toFile().listFiles())
				.map(listFiles -> Stream.of(listFiles).map(File::toPath))
				.orElseGet(Stream::empty);
	}
440956
private Xml getNode(String... path)
    {
        Xml node = root;
        for (final String element : path)
        {
            try
            {
                node = node.getChild(element);
            }
            catch (final LionEngineException exception)
            {
                throw new LionEngineException(exception, media);
            }
        }
        return node;
    }