You are looking at documentation for an older release. Not what you want? See the current release documentation.
The configuration manager allows you to find files using URL with special prefixes that are described below:
war
: Finds a file using the Servlet Context of your
portal.war
or any web applications defined as PortalContainerConfigOwner.
For example, in case of the portal.war
, if the URL is
war:/conf/common/portlet-container-configuration.xml
, it will try to get the file from
portal.war/WEB-INF/conf/common/portlet-container-configuration.xml
.
jar
or classpath: Finds a
file that is accessible using the ClassLoader. For example, jar:/conf/my-file.xml
will be understood as trying to find conf/my-file.xml
from the ClassLoader.
file: Indicates the configuration manager that it needs to interpret the URL as an
absolute path.
For example, file:///path/to/my/file.xml
will be understood as an absolute path.
ar: Accesses a file even if it is inside an archive (.zip
file).
The used path must be absolute. In case your file is inside an archive, you will need to provide the path within
the archive using "!/" as separator between the path of the archive and the path inside the archive.
It is also possible to get a file from an archive that itself is inside another archive but it is not possible to go any further.
So for example, here are types of supported URL:
ar:/path/to/my/file.xml
: Allows accessing the file.xml
file.
In this case, you could also use file:
for the exact same result.
ar:/path/to/my/archive.zip!/path/to/my/file.xml
: Allows accessing
the file.xml
file that is inside archive.zip
.
ar:/path/to/my/archive.zip!/path/to/my/archive2.zip!/path/to/my/file.xml
:
Allows accessing the file.xml
file that is inside the archive:
archive2.zip
which itself is inside archive.zip
.
Without prefixes: It will be understood as a relative path from the parent directory of the last processed configuration file.
For example, if the configuration manager is processing the file corresponding to file:///path/to/my/configuration.xml
and you import dir/to/foo.xml
in this file,
the configuration manager will try to get the file from file:///path/to/my/dir/to/foo.xml
.
Please note that it works also for other prefixes.
In case you use the configuration manager in a component to get a file like the example below, it will be relative to the following directories:
//cmanager is org.exoplatform.container.configuration.ConfigurationManager instance
InputStream is = cmanager.getInputStream("war:/conf/common/locales-config.xml");
It will be a relative path to the exo configuration directory in case of the
RootContainer (assuming that the configuration.xml
file exists there; otherwise it would be hard to know) and from
${exo-configuration-directory}/portal/${portal-container-name}
in case of the PortalContainer
(assuming that a configuration.xml
file exists there; otherwise it would be hard to know).
For more details about the eXo configuration directory, refer to the Configuration Retrieval section.