mirror of
https://github.com/lightbend/config.git
synced 2025-02-20 00:00:48 +08:00
minor tweaks to explanation of classpath includes
This commit is contained in:
parent
ded3604019
commit
4619d05cd2
18
HOCON.md
18
HOCON.md
@ -631,13 +631,17 @@ For plain files on the filesystem:
|
||||
|
||||
For resources located on the Java classpath:
|
||||
|
||||
- included resources are looked up in the same class or class
|
||||
loader as the including resource.
|
||||
- if the included resource name starts with '/' then it
|
||||
should be passed to `getResource()` as-is.
|
||||
- if the included resource name does not start with '/'
|
||||
then it should have the "directory" of the including resource
|
||||
prepended to it, before passing it to `getResource()`.
|
||||
- included resources are looked up by calling `getResource()` on
|
||||
the same class or class loader used to look up the including
|
||||
resource.
|
||||
- if the included resource name is absolute (starts with '/')
|
||||
then it should be passed to `getResource()` as-is.
|
||||
- if the included resource name does not start with '/' then it
|
||||
should have the "directory" of the including resource.
|
||||
prepended to it, before passing it to `getResource()`. If the
|
||||
including resource is not absolute (no '/') and has no "parent
|
||||
directory" (is just a single path element), then the included
|
||||
relative resource name should be left as-is.
|
||||
- it would be wrong to use `getResource()` to get a URL and then
|
||||
locate the included name relative to that URL, because a class
|
||||
loader is not required to have a one-to-one mapping between
|
||||
|
Loading…
Reference in New Issue
Block a user