@Test public void run() throws IOException, URISyntaxException { test.result = PropertyFileUtils.resolvePropertyFiles(test.file); test.run(); }
public static Enumeration<URL> resolvePropertyFiles(String propertyFileName) throws IOException { if (propertyFileName != null && (propertyFileName.contains(": { Vector<URL> propertyFileUrls = new Vector<URL>(); URL url = new URL(propertyFileName); if (propertyFileName.startsWith("file:")) { try { File file = new File(url.toURI()); if (file.exists()) { propertyFileUrls.add(url); } } catch (URISyntaxException e) { throw new IllegalStateException("Property file URL is malformed", e); } } else { propertyFileUrls.add(url); } return propertyFileUrls.elements(); } if (propertyFileName != null) { File file = new File(propertyFileName); if (file.exists()) { return Collections.enumeration(Collections.singleton(file.toURI().toURL())); } } ClassLoader cl = ClassUtils.getClassLoader(null); Enumeration<URL> propertyFileUrls = cl.getResources(propertyFileName); if (!propertyFileUrls.hasMoreElements()) { cl = PropertyFileUtils.class.getClassLoader(); propertyFileUrls = cl.getResources(propertyFileName); } return propertyFileUrls; }
PropertyFileUtils { public static Enumeration<URL> resolvePropertyFiles(String propertyFileName) throws IOException { if (propertyFileName != null && (propertyFileName.contains(": { Vector<URL> propertyFileUrls = new Vector<URL>(); URL url = new URL(propertyFileName); if (propertyFileName.startsWith("file:")) { try { File file = new File(url.toURI()); if (file.exists()) { propertyFileUrls.add(url); } } catch (URISyntaxException e) { throw new IllegalStateException("Property file URL is malformed", e); } } else { propertyFileUrls.add(url); } return propertyFileUrls.elements(); } if (propertyFileName != null) { File file = new File(propertyFileName); if (file.exists()) { return Collections.enumeration(Collections.singleton(file.toURI().toURL())); } } ClassLoader cl = ClassUtils.getClassLoader(null); Enumeration<URL> propertyFileUrls = cl.getResources(propertyFileName); if (!propertyFileUrls.hasMoreElements()) { cl = PropertyFileUtils.class.getClassLoader(); propertyFileUrls = cl.getResources(propertyFileName); } return propertyFileUrls; } }
PropertyFileUtils { public static Enumeration<URL> resolvePropertyFiles(String propertyFileName) throws IOException { if (propertyFileName != null && (propertyFileName.contains(": { Vector<URL> propertyFileUrls = new Vector<URL>(); URL url = new URL(propertyFileName); if (propertyFileName.startsWith("file:")) { try { File file = new File(url.toURI()); if (file.exists()) { propertyFileUrls.add(url); } } catch (URISyntaxException e) { throw new IllegalStateException("Property file URL is malformed", e); } } else { propertyFileUrls.add(url); } return propertyFileUrls.elements(); } if (propertyFileName != null) { File file = new File(propertyFileName); if (file.exists()) { return Collections.enumeration(Collections.singleton(file.toURI().toURL())); } } ClassLoader cl = ClassUtils.getClassLoader(null); Enumeration<URL> propertyFileUrls = cl.getResources(propertyFileName); if (!propertyFileUrls.hasMoreElements()) { cl = PropertyFileUtils.class.getClassLoader(); propertyFileUrls = cl.getResources(propertyFileName); } return propertyFileUrls; } private  PropertyFileUtils(); }
PropertyFileUtils { public static Enumeration<URL> resolvePropertyFiles(String propertyFileName) throws IOException { if (propertyFileName != null && (propertyFileName.contains(": { Vector<URL> propertyFileUrls = new Vector<URL>(); URL url = new URL(propertyFileName); if (propertyFileName.startsWith("file:")) { try { File file = new File(url.toURI()); if (file.exists()) { propertyFileUrls.add(url); } } catch (URISyntaxException e) { throw new IllegalStateException("Property file URL is malformed", e); } } else { propertyFileUrls.add(url); } return propertyFileUrls.elements(); } if (propertyFileName != null) { File file = new File(propertyFileName); if (file.exists()) { return Collections.enumeration(Collections.singleton(file.toURI().toURL())); } } ClassLoader cl = ClassUtils.getClassLoader(null); Enumeration<URL> propertyFileUrls = cl.getResources(propertyFileName); if (!propertyFileUrls.hasMoreElements()) { cl = PropertyFileUtils.class.getClassLoader(); propertyFileUrls = cl.getResources(propertyFileName); } return propertyFileUrls; } private  PropertyFileUtils(); static Enumeration<URL> resolvePropertyFiles(String propertyFileName); static Properties loadProperties(URL url); static ResourceBundle getResourceBundle(String bundleName); static ResourceBundle getResourceBundle(String bundleName, Locale locale); }
PropertyFileUtils { public static Enumeration<URL> resolvePropertyFiles(String propertyFileName) throws IOException { if (propertyFileName != null && (propertyFileName.contains(": { Vector<URL> propertyFileUrls = new Vector<URL>(); URL url = new URL(propertyFileName); if (propertyFileName.startsWith("file:")) { try { File file = new File(url.toURI()); if (file.exists()) { propertyFileUrls.add(url); } } catch (URISyntaxException e) { throw new IllegalStateException("Property file URL is malformed", e); } } else { propertyFileUrls.add(url); } return propertyFileUrls.elements(); } if (propertyFileName != null) { File file = new File(propertyFileName); if (file.exists()) { return Collections.enumeration(Collections.singleton(file.toURI().toURL())); } } ClassLoader cl = ClassUtils.getClassLoader(null); Enumeration<URL> propertyFileUrls = cl.getResources(propertyFileName); if (!propertyFileUrls.hasMoreElements()) { cl = PropertyFileUtils.class.getClassLoader(); propertyFileUrls = cl.getResources(propertyFileName); } return propertyFileUrls; } private  PropertyFileUtils(); static Enumeration<URL> resolvePropertyFiles(String propertyFileName); static Properties loadProperties(URL url); static ResourceBundle getResourceBundle(String bundleName); static ResourceBundle getResourceBundle(String bundleName, Locale locale);  }