mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 15:53:36 +01:00
Initial version
Former-commit-id: e7be5c63fd8ffb67d4813a7804082d282a80e134
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user