1 61 62 package org.apache.commons.discovery.tools; 63 64 import java.util.Properties ; 65 66 import org.apache.commons.discovery.resource.ClassLoaders; 67 68 69 77 public class PropertiesHolder { 78 private Properties properties; 79 private final String propertiesFileName; 80 81 public PropertiesHolder(Properties properties) { 82 this.properties = properties; 83 this.propertiesFileName = null; 84 } 85 86 public PropertiesHolder(String propertiesFileName) { 87 this.properties = null; 88 this.propertiesFileName = propertiesFileName; 89 } 90 91 100 public Properties getProperties(SPInterface spi, ClassLoaders loaders) { 101 if (properties == null) { 102 properties = ResourceUtils.loadProperties(spi.getSPClass(), getPropertiesFileName(), loaders); 103 } 104 return properties; 105 } 106 107 public String getPropertiesFileName() { 108 return propertiesFileName; 109 } 110 } 111 | Popular Tags |