List of usage examples for weka.core WekaPackageManager loadPackages
public static synchronized void loadPackages(boolean verbose)
From source file:adams.core.management.WekaPackagesClassPathAugmenter.java
License:Open Source License
/** * Returns the classpath parts (jars, directories) to add to the classpath. * /* w w w . ja v a 2s . com*/ * @return the additional classpath parts */ public synchronized String[] getClassPathAugmentation() { Environment env; String loadPackages; File[] contents; int i; Package toLoad; boolean load; m_Augmentations = new ArrayList<String>(); // load packages? env = Environment.getSystemWide(); loadPackages = env.getVariableValue("weka.core.loadPackages"); if (loadPackages != null && loadPackages.equalsIgnoreCase("false")) return new String[0]; // init packages WekaPackageManager.loadPackages(false); // try and load any jar files and add to the classpath contents = WekaPackageManager.PACKAGES_DIR.listFiles(); for (i = 0; i < contents.length; i++) { if (contents[i].isDirectory()) { try { toLoad = WekaPackageManager.getInstalledPackageInfo(contents[i].getName()); // Only perform the check against the current version of Weka if there exists // a Description.props file if (toLoad != null) { load = WekaPackageManager.loadCheck(toLoad, contents[i], System.err); if (load) loadPackageDirectory(contents[i]); } } catch (Exception ex) { ex.printStackTrace(); System.err.println("[WEKA] Problem loading package " + contents[i].getName() + " skipping..."); } } } return m_Augmentations.toArray(new String[m_Augmentations.size()]); }