+ //
+ // STATIC METHODS
+ //
+
+ /**
+ * Parses the given configuration file into a {@link Chain}.
+ *
+ * @param configurationFile
+ * The configuration file to parse
+ * @return The parsed chain
+ */
+ private static Chain parseConfigurationFile(File configurationFile) {
+ try {
+ return objectMapper.readValue(configurationFile, Chain.class);
+ } catch (JsonParseException jpe1) {
+ logger.warn(String.format("Could not parse %s.", configurationFile), jpe1);
+ } catch (JsonMappingException jme1) {
+ logger.warn(String.format("Could not parse %s.", configurationFile), jme1);
+ } catch (IOException ioe1) {
+ logger.info(String.format("Could not read %s.", configurationFile));
+ }
+ return null;
+ }
+
+ /**
+ * Extracts the name of the reaction from the given filename.
+ *
+ * @param filename
+ * The filename to extract the reaction name from
+ * @return The name of the reaction
+ */
+ private static String getReactionName(String filename) {
+ return (filename.lastIndexOf(".") > -1) ? filename.substring(0, filename.lastIndexOf(".")) : filename;
+ }
+