// Path: environment.monitor.core/src/main/java/org/yagel/monitor/MonitorConfig.java
// public interface MonitorConfig {
// 
// 
//   Set<EnvironmentConfig> getEnvironments();
// 
// }
// 
// Path: environment.monitor.plugins/src/main/java/org/yagel/monitor/plugins/exception/PluginException.java
// public class PluginException extends RuntimeException {
// 
//   public PluginException(Throwable cause) {
//     super(cause);
//   }
// 
//   public PluginException(String message, Throwable cause) {
//     super(message, cause);
//   }
// }
// 
// Path: environment.monitor.core/src/main/java/org/yagel/monitor/status/collector/MonitorStatusCollectorLoader.java
// public interface MonitorStatusCollectorLoader {
// 
// 
//   MonitorStatusCollector loadCollector(EnvironmentConfig config);
// 
// }


import org.apache.log4j.Logger;
import org.yagel.monitor.MonitorConfig;
import org.yagel.monitor.plugins.exception.PluginException;
import org.yagel.monitor.status.collector.MonitorStatusCollectorLoader;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
package org.yagel.monitor.plugins;



public class JarScanner {

  private final static Logger log = Logger.getLogger(JarScanner.class);
  private final static String MONITOR_CONFIG_FILE_NAME = "EnvMonitor.xml";
  private final static Class<MonitorStatusCollectorLoader> loaderClass = MonitorStatusCollectorLoader.class;
  private final ClassLoader classLoader;
  private Class classProvider;
  private String pathToJar;
  private String cannonicalJarPath;

  public JarScanner(ClassLoader classLoader, String pathToJar) {
    this.classLoader = classLoader;
    this.pathToJar = pathToJar;
    this.cannonicalJarPath = "jar:file:" + pathToJar + "!/";
  }

  public void scanJar() {

    URL[] urls;
    try {
      urls = new URL[]{new URL(cannonicalJarPath)};
    } catch (IOException e) {
// Path: environment.monitor.core/src/main/java/org/yagel/monitor/MonitorConfig.java
// public interface MonitorConfig {
// 
// 
//   Set<EnvironmentConfig> getEnvironments();
// 
// }
// 
// Path: environment.monitor.plugins/src/main/java/org/yagel/monitor/plugins/exception/PluginException.java
// public class PluginException extends RuntimeException {
// 
//   public PluginException(Throwable cause) {
//     super(cause);
//   }
// 
//   public PluginException(String message, Throwable cause) {
//     super(message, cause);
//   }
// }
// 
// Path: environment.monitor.core/src/main/java/org/yagel/monitor/status/collector/MonitorStatusCollectorLoader.java
// public interface MonitorStatusCollectorLoader {
// 
// 
//   MonitorStatusCollector loadCollector(EnvironmentConfig config);
// 
// }


// Path: environment.monitor.plugins/src/main/java/org/yagel/monitor/plugins/JarScanner.java
import org.apache.log4j.Logger;
import org.yagel.monitor.MonitorConfig;
import org.yagel.monitor.plugins.exception.PluginException;
import org.yagel.monitor.status.collector.MonitorStatusCollectorLoader;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

package org.yagel.monitor.plugins;



public class JarScanner {

  private final static Logger log = Logger.getLogger(JarScanner.class);
  private final static String MONITOR_CONFIG_FILE_NAME = "EnvMonitor.xml";
  private final static Class<MonitorStatusCollectorLoader> loaderClass = MonitorStatusCollectorLoader.class;
  private final ClassLoader classLoader;
  private Class classProvider;
  private String pathToJar;
  private String cannonicalJarPath;

  public JarScanner(ClassLoader classLoader, String pathToJar) {
    this.classLoader = classLoader;
    this.pathToJar = pathToJar;
    this.cannonicalJarPath = "jar:file:" + pathToJar + "!/";
  }

  public void scanJar() {

    URL[] urls;
    try {
      urls = new URL[]{new URL(cannonicalJarPath)};
    } catch (IOException e) {
      throw new PluginException("Unable to locate plugin jar by path provided", e);