Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1.     ClassLoader classLoader = pluginManager.getClassLoader("reporting-plugin");
  2.     return PentahoSystem.getSystemSetting(getSystemRelativePluginPath(classLoader) + "/settings.xml", key, defaultVal);
  3.  
  4.   public String getSystemRelativePluginPath(ClassLoader classLoader) {
  5.     File dir = getPluginDir(classLoader);
  6.     if (dir == null) {
  7.       return null;
  8.     }
  9.     // get the full path with \ converted to /
  10.     String path = dir.getAbsolutePath().replace('\\', ISolutionRepository.SEPARATOR);
  11.     int pos = path.lastIndexOf(ISolutionRepository.SEPARATOR + "system" + ISolutionRepository.SEPARATOR); //$NON-NLS-1$
  12.     if (pos != -1) {
  13.       path = path.substring(pos + 8);
  14.     }
  15.     return path;
  16.   }
  17.  
  18.   protected File getPluginDir(ClassLoader classLoader) {
  19.     if (classLoader instanceof PluginClassLoader) {
  20.       return ((PluginClassLoader) classLoader).getPluginDir();
  21.     }
  22.     return null;
  23.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement