Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ClassLoader classLoader = pluginManager.getClassLoader("reporting-plugin");
- return PentahoSystem.getSystemSetting(getSystemRelativePluginPath(classLoader) + "/settings.xml", key, defaultVal);
- public String getSystemRelativePluginPath(ClassLoader classLoader) {
- File dir = getPluginDir(classLoader);
- if (dir == null) {
- return null;
- }
- // get the full path with \ converted to /
- String path = dir.getAbsolutePath().replace('\\', ISolutionRepository.SEPARATOR);
- int pos = path.lastIndexOf(ISolutionRepository.SEPARATOR + "system" + ISolutionRepository.SEPARATOR); //$NON-NLS-1$
- if (pos != -1) {
- path = path.substring(pos + 8);
- }
- return path;
- }
- protected File getPluginDir(ClassLoader classLoader) {
- if (classLoader instanceof PluginClassLoader) {
- return ((PluginClassLoader) classLoader).getPluginDir();
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement