@Test public void load1() throws LoaderException, IOException { final String path = "/context.properties"; PropertiesLoader.load(path, true); }
public static Properties load(final String path) { try { InputStream input = null; try { final Resource resource = new ClassPathResource(path); input = resource.getInputStream(); } catch (final IOException e) { } final Properties properties; if (input != null) { properties = PropertiesLoader.load(input); } else { properties = PropertiesLoader.load(ResourceUtils.getFile(path)); } return properties; } catch (final IOException e) { throw new LoaderException("加载属性文件异常: " + e.getMessage(), e); } }
PropertiesLoader { public static Properties load(final String path) { try { InputStream input = null; try { final Resource resource = new ClassPathResource(path); input = resource.getInputStream(); } catch (final IOException e) { } final Properties properties; if (input != null) { properties = PropertiesLoader.load(input); } else { properties = PropertiesLoader.load(ResourceUtils.getFile(path)); } return properties; } catch (final IOException e) { throw new LoaderException("加载属性文件异常: " + e.getMessage(), e); } } }
PropertiesLoader { public static Properties load(final String path) { try { InputStream input = null; try { final Resource resource = new ClassPathResource(path); input = resource.getInputStream(); } catch (final IOException e) { } final Properties properties; if (input != null) { properties = PropertiesLoader.load(input); } else { properties = PropertiesLoader.load(ResourceUtils.getFile(path)); } return properties; } catch (final IOException e) { throw new LoaderException("加载属性文件异常: " + e.getMessage(), e); } } private  PropertiesLoader(); }
PropertiesLoader { public static Properties load(final String path) { try { InputStream input = null; try { final Resource resource = new ClassPathResource(path); input = resource.getInputStream(); } catch (final IOException e) { } final Properties properties; if (input != null) { properties = PropertiesLoader.load(input); } else { properties = PropertiesLoader.load(ResourceUtils.getFile(path)); } return properties; } catch (final IOException e) { throw new LoaderException("加载属性文件异常: " + e.getMessage(), e); } } private  PropertiesLoader(); static Properties load(final String path); static Properties load(final InputStream input); @Deprecated static void load(final String contextPath, final InputStream stream, final boolean loadContext); static void load(final String contextPath, final boolean loadContext); }
PropertiesLoader { public static Properties load(final String path) { try { InputStream input = null; try { final Resource resource = new ClassPathResource(path); input = resource.getInputStream(); } catch (final IOException e) { } final Properties properties; if (input != null) { properties = PropertiesLoader.load(input); } else { properties = PropertiesLoader.load(ResourceUtils.getFile(path)); } return properties; } catch (final IOException e) { throw new LoaderException("加载属性文件异常: " + e.getMessage(), e); } } private  PropertiesLoader(); static Properties load(final String path); static Properties load(final InputStream input); @Deprecated static void load(final String contextPath, final InputStream stream, final boolean loadContext); static void load(final String contextPath, final boolean loadContext); static final Map<String, Properties> PROPERTIES; static final String CONTEXT; }