Clover Coverage Report - SmartWeb
Coverage timestamp: Sun Jun 8 2008 21:20:12 CEST
../../../../img/srcFileCovDistChart0.png 29% of files have more coverage
5   58   2   2,5
0   18   0,4   2
2     1  
1    
 
  FileDomainConfigurationStrategy       Line # 38 5 2 0% 0.0
 
No Tests
 
1    /*
2    * The SmartWeb Framework
3    * Copyright (C) 2004-2006
4    *
5    * This library is free software; you can redistribute it and/or
6    * modify it under the terms of the GNU Lesser General Public
7    * License as published by the Free Software Foundation; either
8    * version 2.1 of the License, or (at your option) any later version.
9    *
10    * This library is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this library; if not, write to the Free Software
17    * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18    *
19    * For further informations on the SmartWeb Framework please visit
20    *
21    * http://smartweb.sourceforge.net
22    */
23    package net.smartlab.web.config;
24   
25    import java.net.URL;
26   
27    import net.smartlab.config.Configuration;
28    import net.smartlab.config.ConfigurationException;
29    import net.smartlab.config.XMLConfiguration;
30    import net.smartlab.web.Domain;
31   
32   
33    /**
34    * @TODO documentation
35    * @author rlogiacco@smartlab.net
36    *
37    */
 
38    public class FileDomainConfigurationStrategy implements DomainConfigurationStrategy {
39   
40    /**
41    * @throws ConfigurationException
42    * @see net.smartlab.web.config.FactoryConfigurationStrategy#getConfiguration()
43    */
 
44  0 toggle public Configuration getConfiguration(Domain domain) throws ConfigurationException {
45  0 String archive = Domain.getLastArchiveName(domain.getClass());
46  0 URL file = Domain.getResource(this.getClass(), new String[] {"/META-INF/" + archive + ".xml",
47    "/META-INF/smartweb.jar.xml"});
48  0 return new XMLConfiguration(file);
49    }
50   
51    /**
52    * @see net.smartlab.web.config.FactoryConfigurationStrategy#getConfiguration(java.lang.String)
53    */
 
54  0 toggle public Configuration getConfiguration(Domain domain, String filename) throws ConfigurationException {
55  0 URL file = Domain.getResource(this.getClass(), new String[] {"/META-INF/" + filename});
56  0 return new XMLConfiguration(file);
57    }
58    }