protected Properties buildProperties(Processor processor, File propertiesFile, File ... extraFiles) throws IOException { Properties properties = new Properties(); for (File extraFile : extraFiles) { properties.putAll(processor.loadProperties(extraFile)); } if (propertiesFile != null) { properties.putAll(processor.loadProperties(propertiesFile)); } return properties; }
/** * Helper to load a properties file from disk. * * @param file * @return * @throws IOException */ public Properties loadProperties(File file) throws IOException { updateModified(file.lastModified(), "Properties file: " + file); InputStream in = new FileInputStream(file); try { Properties p = loadProperties(in, file.getAbsolutePath()); return p; } finally { in.close(); } }
/** * Helper to load a properties file from disk. * * @param file * @return * @throws IOException */ public Properties loadProperties(File file) throws IOException { updateModified(file.lastModified(), "Properties file: " + file); InputStream in = new FileInputStream(file); try { Properties p = loadProperties(in, file.getAbsolutePath()); return p; } finally { in.close(); } }
/** * Helper to load a properties file from disk. * * @param file * @return * @throws IOException */ public Properties loadProperties(File file) throws IOException { updateModified(file.lastModified(), "Properties file: " + file); InputStream in = new FileInputStream(file); try { Properties p = loadProperties(in, file.getAbsolutePath()); return p; } finally { in.close(); } }
public void addProperties(File file) throws Exception { addIncluded(file); Properties p = loadProperties(file); setProperties(p); }
public void addProperties(File file) throws Exception { addIncluded(file); Properties p = loadProperties(file); setProperties(p); }
public void addProperties(File file) throws Exception { addIncluded(file); Properties p = loadProperties(file); setProperties(p); }
public void addProperties(File file) throws Exception { addIncluded(file); Properties p = loadProperties(file); setProperties(p); }
public void addProperties(File file) throws Exception { addIncluded(file); Properties p = loadProperties(file); setProperties(p); }
public void setProperties(File propertiesFile, File base) { this.propertiesFile = propertiesFile.getAbsoluteFile(); setBase(base); try { if (propertiesFile.isFile()) { // System.err.println("Loading properties " + propertiesFile); long modified = propertiesFile.lastModified(); if (modified > System.currentTimeMillis() + 100) { System.err.println("Huh? This is in the future " + propertiesFile); this.modified = System.currentTimeMillis(); } else this.modified = modified; included.clear(); Properties p = loadProperties(propertiesFile); setProperties(p); } else { if (fileMustExist) { error("No such properties file: %s", propertiesFile); } } } catch (IOException e) { error("Could not load properties %s", propertiesFile); } }
public void setProperties(File propertiesFile, File base) { this.propertiesFile = propertiesFile.getAbsoluteFile(); setBase(base); try { if (propertiesFile.isFile()) { // System.err.println("Loading properties " + propertiesFile); long modified = propertiesFile.lastModified(); if (modified > System.currentTimeMillis() + 100) { System.err.println("Huh? This is in the future " + propertiesFile); this.modified = System.currentTimeMillis(); } else this.modified = modified; included.clear(); Properties p = loadProperties(propertiesFile); setProperties(p); } else { if (fileMustExist) { error("No such properties file: %s", propertiesFile); } } } catch (IOException e) { error("Could not load properties %s", propertiesFile); } }
public void setProperties(File propertiesFile, File base) { this.propertiesFile = propertiesFile.getAbsoluteFile(); setBase(base); try { if (propertiesFile.isFile()) { // System.err.println("Loading properties " + propertiesFile); long modified = propertiesFile.lastModified(); if (modified > System.currentTimeMillis() + 100) { System.err.println("Huh? This is in the future " + propertiesFile); this.modified = System.currentTimeMillis(); } else this.modified = modified; included = null; Properties p = loadProperties(propertiesFile); setProperties(p); } else { if (fileMustExist) { error("No such properties file: " + propertiesFile); } } } catch (IOException e) { error("Could not load properties " + propertiesFile); } }
public void setProperties(File propertiesFile, File base) { this.propertiesFile = propertiesFile.getAbsoluteFile(); setBase(base); try { if (propertiesFile.isFile()) { // System.err.println("Loading properties " + propertiesFile); long modified = propertiesFile.lastModified(); if (modified > System.currentTimeMillis() + 100) { System.err.println("Huh? This is in the future " + propertiesFile); this.modified = System.currentTimeMillis(); } else this.modified = modified; included = null; Properties p = loadProperties(propertiesFile); setProperties(p); } else { if (fileMustExist) { error("No such properties file: " + propertiesFile); } } } catch (IOException e) { error("Could not load properties " + propertiesFile); } }
public void mergeProperties(File file, boolean override) { if (file.isFile()) { try { Properties properties = loadProperties(file); mergeProperties(properties, override); } catch (Exception e) { error("Error loading properties file: %s", file); } } else { if (!file.exists()) error("Properties file does not exist: %s", file); else error("Properties file must a file, not a directory: %s", file); } }
public void setProperties(File propertiesFile, File base) { this.propertiesFile = propertiesFile.getAbsoluteFile(); setBase(base); try { if (propertiesFile.isFile()) { // System.err.println("Loading properties " + propertiesFile); long modified = propertiesFile.lastModified(); if (modified > System.currentTimeMillis() + 100) { System.err.println("Huh? This is in the future " + propertiesFile); this.modified = System.currentTimeMillis(); } else this.modified = modified; included = null; Properties p = loadProperties(propertiesFile); setProperties(p); } else { if (fileMustExist) { error("No such properties file: " + propertiesFile); } } } catch (IOException e) { error("Could not load properties " + propertiesFile); } }
sub = loadProperties(file);
public void mergeProperties(File file, boolean override) { if (file.isFile()) { try { Properties properties = loadProperties(file); mergeProperties(properties, override); } catch (Exception e) { error("Error loading properties file: %s", file); } } else { if (!file.exists()) error("Properties file does not exist: %s", file); else error("Properties file must a file, not a directory: %s", file); } }
public void mergeProperties(File file, boolean override) { if (file.isFile()) { try { Properties properties = loadProperties(file); mergeProperties(properties, override); } catch (Exception e) { error("Error loading properties file: " + file); } } else { if (!file.exists()) error("Properties file does not exist: " + file); else error("Properties file must a file, not a directory: " + file); } }
public void mergeProperties(File file, boolean override) { if (file.isFile()) { try { Properties properties = loadProperties(file); mergeProperties(properties, override); } catch (Exception e) { error("Error loading properties file: " + file); } } else { if (!file.exists()) error("Properties file does not exist: " + file); else error("Properties file must a file, not a directory: " + file); } }
public void mergeProperties(File file, boolean override) { if (file.isFile()) { try { Properties properties = loadProperties(file); mergeProperties(properties, override); } catch (Exception e) { error("Error loading properties file: " + file); } } else { if (!file.exists()) error("Properties file does not exist: " + file); else error("Properties file must a file, not a directory: " + file); } }