mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-17 23:04:07 +01:00
added findbugs suppression for a non-issue and made a few checkstyle corrections
Former-commit-id: 60a3757ce97ec7cccc07b66ef4541db3e2c2bdac
This commit is contained in:
@@ -181,7 +181,11 @@ public class CveDB {
|
|||||||
* @throws IOException thrown if there is an IO Exception
|
* @throws IOException thrown if there is an IO Exception
|
||||||
* @throws SQLException thrown if there is a SQL Exception
|
* @throws SQLException thrown if there is a SQL Exception
|
||||||
* @throws DatabaseException thrown if there is an error initializing a new database
|
* @throws DatabaseException thrown if there is an error initializing a new database
|
||||||
|
* @throws ClassNotFoundException thrown if the h2 database driver cannot be loaded
|
||||||
*/
|
*/
|
||||||
|
@edu.umd.cs.findbugs.annotations.SuppressWarnings(
|
||||||
|
value = "DMI_EMPTY_DB_PASSWORD",
|
||||||
|
justification = "Yes, I know... Blank password. With the embedded DB the password doesn't have any affect.")
|
||||||
public void open() throws IOException, SQLException, DatabaseException, ClassNotFoundException {
|
public void open() throws IOException, SQLException, DatabaseException, ClassNotFoundException {
|
||||||
final String fileName = CveDB.getDataDirectory().getCanonicalPath()
|
final String fileName = CveDB.getDataDirectory().getCanonicalPath()
|
||||||
+ File.separator
|
+ File.separator
|
||||||
@@ -190,7 +194,7 @@ public class CveDB {
|
|||||||
final boolean createTables = !f.exists();
|
final boolean createTables = !f.exists();
|
||||||
final String connStr = "jdbc:h2:file:" + fileName;
|
final String connStr = "jdbc:h2:file:" + fileName;
|
||||||
Class.forName("org.h2.Driver");
|
Class.forName("org.h2.Driver");
|
||||||
conn = DriverManager.getConnection(connStr, "sa", "");
|
conn = DriverManager.getConnection(connStr, "local", "");
|
||||||
if (createTables) {
|
if (createTables) {
|
||||||
createTables();
|
createTables();
|
||||||
}
|
}
|
||||||
@@ -408,7 +412,7 @@ public class CveDB {
|
|||||||
*/
|
*/
|
||||||
public static File getDataDirectory() throws IOException {
|
public static File getDataDirectory() throws IOException {
|
||||||
final String fileName = Settings.getString(Settings.KEYS.CVE_INDEX);
|
final String fileName = Settings.getString(Settings.KEYS.CVE_INDEX);
|
||||||
File path = FileUtils.getDataDirectory(fileName, CveDB.class);
|
final File path = FileUtils.getDataDirectory(fileName, CveDB.class);
|
||||||
if (!path.exists()) {
|
if (!path.exists()) {
|
||||||
if (!path.mkdirs()) {
|
if (!path.mkdirs()) {
|
||||||
throw new IOException("Unable to create NVD CVE Data directory");
|
throw new IOException("Unable to create NVD CVE Data directory");
|
||||||
|
|||||||
Reference in New Issue
Block a user