Initial version

Former-commit-id: 649d9e94e9e9c771a4efdace79ec8ddca0cc1af4
This commit is contained in:
Jeremy Long
2014-01-05 07:13:50 -05:00
parent 6ab5388075
commit b569ad4ef5
2 changed files with 85 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
/*
* This file is part of dependency-check-core.
*
* Dependency-check-core is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Dependency-check-core is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* dependency-check-core. If not, see http://www.gnu.org/licenses/.
*
* Copyright (c) 2014 Jeremy Long. All Rights Reserved.
*/
package org.owasp.dependencycheck.data.nvdcve;
import java.sql.Connection;
/**
* When implementing this, use code from the following to load the driver.
* http://stackoverflow.com/questions/5674637/loading-jdbc-driver-at-runtime
*
*
* @author Jeremy Long (jeremy.long@owasp.org)
*/
public final class ConnectionFactory {
/**
* Private constructor for this factory class; no instance is ever needed.
*/
private ConnectionFactory() {
}
public static Connection getConnection() {
return null;
}
}

View File

@@ -0,0 +1,44 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.owasp.dependencycheck.data.nvdcve;
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
/**
*
* @author Jeremy Long (jeremy.long@owasp.org)
*/
public class DriverClassLoader extends URLClassLoader {
/**
* Constructs a new DriverClassLoader that performs a deep copy of the URLs
* in the provided class loader.
*
*/
public DriverClassLoader(File pathToDriver, ClassLoader parent) {
File driverFolder = new File("driver");
File[] files = driverFolder.listFiles();
for (File file : files) {
try {
loader.addURL(file.toURI().toURL());
} catch (MalformedURLException e) {
}
}
super(urls, parent);
}
/**
* Add additional URLs to the class loader.
*
* @param url the URL to add to the class loader
*/
@Override
public void addURL(URL url) {
super.addURL(url);
}
}