@Test(expected = IOException.class) public void nonexistant_file() throws Exception { new ImportStatement(new File(file, "othername"), file.getName(), ALL).read(); }
public Configuration read() throws IOException, ConfigurationException { final Configuration config_file; try (final Reader input = new FileReader(cfg_file_)) { config_file = Configuration.readFromFile(cfg_file_.getParentFile(), input).resolve(); } if (selector_ == ALL) return config_file; return new Configuration(emptyList(), ((selector_ & MONITORS) == MONITORS ? config_file.getMonitors() : emptyList()), ((selector_ & RULES) == RULES ? config_file.getRules() : emptyList())); }
ImportStatement implements ConfigStatement { public Configuration read() throws IOException, ConfigurationException { final Configuration config_file; try (final Reader input = new FileReader(cfg_file_)) { config_file = Configuration.readFromFile(cfg_file_.getParentFile(), input).resolve(); } if (selector_ == ALL) return config_file; return new Configuration(emptyList(), ((selector_ & MONITORS) == MONITORS ? config_file.getMonitors() : emptyList()), ((selector_ & RULES) == RULES ? config_file.getRules() : emptyList())); } }
ImportStatement implements ConfigStatement { public Configuration read() throws IOException, ConfigurationException { final Configuration config_file; try (final Reader input = new FileReader(cfg_file_)) { config_file = Configuration.readFromFile(cfg_file_.getParentFile(), input).resolve(); } if (selector_ == ALL) return config_file; return new Configuration(emptyList(), ((selector_ & MONITORS) == MONITORS ? config_file.getMonitors() : emptyList()), ((selector_ & RULES) == RULES ? config_file.getRules() : emptyList())); } ImportStatement(File dir, String fname);  ImportStatement(File dir, String fname, int selector); }
ImportStatement implements ConfigStatement { public Configuration read() throws IOException, ConfigurationException { final Configuration config_file; try (final Reader input = new FileReader(cfg_file_)) { config_file = Configuration.readFromFile(cfg_file_.getParentFile(), input).resolve(); } if (selector_ == ALL) return config_file; return new Configuration(emptyList(), ((selector_ & MONITORS) == MONITORS ? config_file.getMonitors() : emptyList()), ((selector_ & RULES) == RULES ? config_file.getRules() : emptyList())); } ImportStatement(File dir, String fname);  ImportStatement(File dir, String fname, int selector); Configuration read(); File getConfigFile(); @Override StringBuilder configString(); @Override int hashCode(); @Override boolean equals(Object obj); }
ImportStatement implements ConfigStatement { public Configuration read() throws IOException, ConfigurationException { final Configuration config_file; try (final Reader input = new FileReader(cfg_file_)) { config_file = Configuration.readFromFile(cfg_file_.getParentFile(), input).resolve(); } if (selector_ == ALL) return config_file; return new Configuration(emptyList(), ((selector_ & MONITORS) == MONITORS ? config_file.getMonitors() : emptyList()), ((selector_ & RULES) == RULES ? config_file.getRules() : emptyList())); } ImportStatement(File dir, String fname);  ImportStatement(File dir, String fname, int selector); Configuration read(); File getConfigFile(); @Override StringBuilder configString(); @Override int hashCode(); @Override boolean equals(Object obj); final static int CONSTANTS; final static int MONITORS; final static int RULES; final static int ALERTS; final static int ALL; }