Beispiel #1
0
 private void loadExternalPlugins() {
   File homeDir = new File(System.getProperty("user.home"));
   File pluginDir = new File(homeDir, Util.PRIVATE_DIR_NAME);
   if (pluginDir.exists() && pluginDir.isDirectory()) {
     String files[] = pluginDir.list();
     for (String fn : files) {
       File f = new File(pluginDir, fn);
       try {
         if (fn.endsWith(".jar")) {
           loadExternalJavaPlugin(f);
         }
         if (fn.endsWith(".xml")) {
           loadExternalXmlPlugin(f);
         }
       } catch (Exception e) {
         System.err.println("Error loading external plugin: " + f.getAbsolutePath());
         e.printStackTrace();
       }
     }
   }
 }