そのドキュメントには、絶対パスを取得したいベース URL といくつかの相対 URI があります。
たとえば、base = https://example.com/some/path.html?query=stringおよびそのドキュメント内の相対 URI:
- index.html → https://example.com/some/index.html
- .. → https://example.com/
- ../../../../abc → https://example.com/abc
- abc/.. → https://example.com/some/
- //example.org/ → https://example.org/
- ftp://example.net/ → ftp://example.net/
Java では、それを実現するクラス URLがあります。
URL abs = new URL(new URL(basePath), relPath);
しかし、不思議なことに、それを実現する単純な C ライブラリや関数を見つけることができません。
その機能を証明するライブラリはありますか? それとも、自己完結型の小さなファイルを使用できるのでしょうか?