- private static Configuration loadConfiguration(String configurationFile) throws IOException {
- try (FileInputStream configInputStream = new FileInputStream(configurationFile)) {
- return Configuration.from(configInputStream);
- }
- }
-
- private static EmailAction createErrorEmailAction(Configuration configuration) {
- return new EmailAction(configuration.getSmtpHostname(), configuration.getErrorEmailSender(), configuration.getErrorEmailRecipient());
- }
-
- /**
- * Definition of the command-line parameters.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
- private static interface Parameters {
-
- /**
- * Returns the directory to watch for chains.
- *
- * @return The chain directory
- */
- @Option(defaultValue = "chains", longName = "chains", shortName = "c", description = "The directory to watch for chains")
- String getChainDirectory();
-
- /**
- * Returns the directory to store states in.
- *
- * @return The states directory
- */
- @Option(defaultValue = "states", longName = "states", shortName = "s", description = "The directory to store states in")
- String getStateDirectory();
-
- @Option(defaultValue = "/etc/rhynodge/rhynodge.json", longName = "config", shortName = "C", description = "The name of the configuration file")
- String getConfigurationFile();
-
+ private static EmailAction createErrorEmailAction(String smtpHostname, String errorEmailSender, String errorEmailRecipient) {
+ return new EmailAction(smtpHostname, errorEmailSender, errorEmailRecipient);