@Test (expected = NullPointerException.class) public void testLoadNullFile () throws IOException { CacheConfig config = new CacheConfig(); config.load(null); }
@Override public void load(File file) throws IOException { if (file == null) { throw new NullPointerException("file cannot be null."); } if (!file.exists()) { throw new FileNotFoundException("mysql config file doesnt exists: " + file.getAbsolutePath()); } Ini ini = new Ini(file); Profile.Section section = ini.get("Cache"); CACHE_PATH = section.getOrDefault("path", "./cache/"); }
CacheConfig implements ConfigLoader { @Override public void load(File file) throws IOException { if (file == null) { throw new NullPointerException("file cannot be null."); } if (!file.exists()) { throw new FileNotFoundException("mysql config file doesnt exists: " + file.getAbsolutePath()); } Ini ini = new Ini(file); Profile.Section section = ini.get("Cache"); CACHE_PATH = section.getOrDefault("path", "./cache/"); } }
CacheConfig implements ConfigLoader { @Override public void load(File file) throws IOException { if (file == null) { throw new NullPointerException("file cannot be null."); } if (!file.exists()) { throw new FileNotFoundException("mysql config file doesnt exists: " + file.getAbsolutePath()); } Ini ini = new Ini(file); Profile.Section section = ini.get("Cache"); CACHE_PATH = section.getOrDefault("path", "./cache/"); }  }
CacheConfig implements ConfigLoader { @Override public void load(File file) throws IOException { if (file == null) { throw new NullPointerException("file cannot be null."); } if (!file.exists()) { throw new FileNotFoundException("mysql config file doesnt exists: " + file.getAbsolutePath()); } Ini ini = new Ini(file); Profile.Section section = ini.get("Cache"); CACHE_PATH = section.getOrDefault("path", "./cache/"); }  @Override void load(File file); }
CacheConfig implements ConfigLoader { @Override public void load(File file) throws IOException { if (file == null) { throw new NullPointerException("file cannot be null."); } if (!file.exists()) { throw new FileNotFoundException("mysql config file doesnt exists: " + file.getAbsolutePath()); } Ini ini = new Ini(file); Profile.Section section = ini.get("Cache"); CACHE_PATH = section.getOrDefault("path", "./cache/"); }  @Override void load(File file); static String CACHE_PATH; }