@Test public void testFile() { makeFile(); PropertiesLoader loader = new PropertiesLoader(filePath); loader.init(); assertEquals("k001", loader.getProperty("k1")); assertEquals("k002", loader.getProperty("k2")); }
@Override public void init() { if (this.ready) { return; } this.ready = true; this.resources.addAll(this.parse(this.locations)); for (SourceResource resource : this.resources) { try (Reader reader = this.getReader(resource)) { if (log.isDebugEnabled()) { log.debug("loading resource [{}]", resource.path()); } props.load(reader); } catch (IOException e) { if (log.isDebugEnabled()) { log.debug("resource [{}] read error", resource.path(), e); } if (!ignoreNotFound) { throw Exceptions.wrap(e); } } } }
PropertiesLoader extends AbstractResourceLoader implements PropertySource { @Override public void init() { if (this.ready) { return; } this.ready = true; this.resources.addAll(this.parse(this.locations)); for (SourceResource resource : this.resources) { try (Reader reader = this.getReader(resource)) { if (log.isDebugEnabled()) { log.debug("loading resource [{}]", resource.path()); } props.load(reader); } catch (IOException e) { if (log.isDebugEnabled()) { log.debug("resource [{}] read error", resource.path(), e); } if (!ignoreNotFound) { throw Exceptions.wrap(e); } } } } }
PropertiesLoader extends AbstractResourceLoader implements PropertySource { @Override public void init() { if (this.ready) { return; } this.ready = true; this.resources.addAll(this.parse(this.locations)); for (SourceResource resource : this.resources) { try (Reader reader = this.getReader(resource)) { if (log.isDebugEnabled()) { log.debug("loading resource [{}]", resource.path()); } props.load(reader); } catch (IOException e) { if (log.isDebugEnabled()) { log.debug("resource [{}] read error", resource.path(), e); } if (!ignoreNotFound) { throw Exceptions.wrap(e); } } } } PropertiesLoader(String... locations);  PropertiesLoader(ClassLoader loader, String... locations); }
PropertiesLoader extends AbstractResourceLoader implements PropertySource { @Override public void init() { if (this.ready) { return; } this.ready = true; this.resources.addAll(this.parse(this.locations)); for (SourceResource resource : this.resources) { try (Reader reader = this.getReader(resource)) { if (log.isDebugEnabled()) { log.debug("loading resource [{}]", resource.path()); } props.load(reader); } catch (IOException e) { if (log.isDebugEnabled()) { log.debug("resource [{}] read error", resource.path(), e); } if (!ignoreNotFound) { throw Exceptions.wrap(e); } } } } PropertiesLoader(String... locations);  PropertiesLoader(ClassLoader loader, String... locations); @Override int order(); @Override Properties props(); @Override void init(); @Override String name(); }
PropertiesLoader extends AbstractResourceLoader implements PropertySource { @Override public void init() { if (this.ready) { return; } this.ready = true; this.resources.addAll(this.parse(this.locations)); for (SourceResource resource : this.resources) { try (Reader reader = this.getReader(resource)) { if (log.isDebugEnabled()) { log.debug("loading resource [{}]", resource.path()); } props.load(reader); } catch (IOException e) { if (log.isDebugEnabled()) { log.debug("resource [{}] read error", resource.path(), e); } if (!ignoreNotFound) { throw Exceptions.wrap(e); } } } } PropertiesLoader(String... locations);  PropertiesLoader(ClassLoader loader, String... locations); @Override int order(); @Override Properties props(); @Override void init(); @Override String name();  }