public static Properties getProperties(final File file) throws IOException { try (FileReader reader = new FileReader(file)) { return getProperties(reader); } }
public static Properties getProperties(final File file) throws IOException { try (FileReader reader = new FileReader(file)) { return getProperties(reader); } }
public static Properties getProperties(final String fileName) throws IOException { return getProperties(new File(fileName)); }
public static Properties getProperties(final String fileName) throws IOException { return getProperties(new File(fileName)); }
public static Properties getProperties(final URL url) throws IOException { try (InputStreamReader reader = new InputStreamReader(url.openStream())) { return getProperties(reader); } }
public static Properties getProperties(final URL url) throws IOException { try (InputStreamReader reader = new InputStreamReader(url.openStream())) { return getProperties(reader); } }
private static void addPropertiesFrom(File clientFolder, Properties result, String... strings) throws IOException { File folder = FileUtils.getFile(clientFolder, strings); if (folder.exists()) { final Properties defaultProperties = PropertiesManager.getProperties(folder); result.putAll(defaultProperties); } }
private static void addPropertiesFrom(File clientFolder, Properties result, String... strings) throws IOException { File folder = FileUtils.getFile(clientFolder, strings); if (folder.exists()) { final Properties defaultProperties = PropertiesManager.getProperties(folder); result.putAll(defaultProperties); } }
@Override public boolean readFromBarFolder(final BusinessArchive businessArchive, final File barFolder) throws IOException { final File file = new File(barFolder, PARAMETERS_FILE); if (!file.exists()) { return false; } final Properties properties = PropertiesManager.getProperties(file); final Map<String, String> parameters = new HashMap<>(properties.size()); for (final Entry<Object, Object> property : properties.entrySet()) { parameters.put((String) property.getKey(), (String) (NULL.equals(property.getValue()) ? null : property.getValue())); } businessArchive.setParameters(parameters); return true; }
@Override public boolean readFromBarFolder(final BusinessArchive businessArchive, final File barFolder) throws IOException { final File file = new File(barFolder, PARAMETERS_FILE); if (!file.exists()) { return false; } final Properties properties = PropertiesManager.getProperties(file); final Map<String, String> parameters = new HashMap<>(properties.size()); for (final Entry<Object, Object> property : properties.entrySet()) { parameters.put((String) property.getKey(), (String) (NULL.equals(property.getValue()) ? null : property.getValue())); } businessArchive.setParameters(parameters); return true; }