1 17 package org.alfresco.config.source; 18 19 import java.io.InputStream ; 20 import java.util.Collections ; 21 import java.util.List ; 22 23 import org.apache.commons.logging.Log; 24 import org.apache.commons.logging.LogFactory; 25 26 31 public class ClassPathConfigSource extends BaseConfigSource 32 { 33 private static Log logger = LogFactory.getLog(ClassPathConfigSource.class); 34 35 42 public ClassPathConfigSource(String classpath) 43 { 44 this(Collections.singletonList(classpath)); 45 } 46 47 52 public ClassPathConfigSource(List <String > sourceStrings) 53 { 54 super(sourceStrings); 55 } 56 57 63 public InputStream getInputStream(String sourceString) 64 { 65 InputStream is = this.getClass().getClassLoader().getResourceAsStream(sourceString); 66 67 if (is == null && logger.isDebugEnabled()) 68 { 69 logger.debug("Failed to obtain input stream to classpath: " + sourceString); 70 } 71 72 return is; 73 } 74 } 75 | Popular Tags |