public static H2DBShutdownHook getHook ( Settings settings ) { try { final String className = settings . getString ( Settings . KEYS . H2DB_SHUTDOWN_HOOK , "org.owasp.dependencycheck.utils.H2DBCleanupHook" ) ; final Class < ? > type = Class . forName ( className ) ; return ( H2DBShutdownHook ) type . getDeclaredConstructor ( ) . newInstance ( ) ; } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException ex ) { LOGGER . debug ( "Failed to instantiate {}, using default shutdown hook instead" , ex ) ; return new H2DBCleanupHook ( ) ; } }
Creates a new H2DB Shutdown Hook .