Subversion Repositories XServices

Compare Revisions

Ignore whitespace Rev 185 → Rev 175

/xservices/trunk/src/java/net/brutex/xservices/ws/rs/DIMCMInfoImpl.java
33,20 → 33,16
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
 
import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.builder.fluent.Configurations;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.commons.jcs.JCS;
import org.apache.commons.jcs.access.CacheAccess;
import org.apache.commons.jcs.access.exception.CacheException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
 
import net.brutex.xservices.cmtypes.ItemType;
import net.brutex.xservices.cmtypes.ItemTypeList;
import net.brutex.xservices.types.FileInfoType;
import net.brutex.xservices.util.FileWalker;
 
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.jcs.JCS;
import org.apache.jcs.access.exception.CacheException;
import org.apache.log4j.Logger;
 
 
/*
80,7 → 76,7
*/
public class DIMCMInfoImpl implements DIMCMInfo {
 
Logger logger = LogManager.getLogger();
Logger logger = Logger.getLogger(DIMCMInfoImpl.class);
 
/*
* (non-Javadoc)
97,7 → 93,7
/*
* try to hit cache first
*/
CacheAccess<Object, Object> cache = JCS.getInstance("DIMCM");
JCS cache = JCS.getInstance("DIMCM");
String cachekey = projSpec + directory + String.valueOf(recursive);
if(useCache) {
ItemTypeList cacheresult = (ItemTypeList) cache.get(cachekey);
332,8 → 328,7
*/
PropertiesConfiguration props;
try {
props = new Configurations().properties(this.getClass()
props = new PropertiesConfiguration(this.getClass()
.getClassLoader().getResource("/../dimcm.properties"));
} catch (ConfigurationException e) {
e.printStackTrace();
354,13 → 349,11
private String getBaseURL() {
final String CACHE_BASEURL = "DIMCM.conf.baseurl";
try {
CacheAccess<Object, Object> cache = JCS.getInstance("DIMCM");
JCS cache = JCS.getInstance("DIMCM");
String baseurl = (String) cache.get(CACHE_BASEURL);
if(baseurl != null) return baseurl;
Configurations configs = new Configurations();
PropertiesConfiguration props = configs.properties((this.getClass().getClassLoader().getResource("/../dimcm.properties")));
PropertiesConfiguration props = new PropertiesConfiguration(this.getClass().getClassLoader().getResource("/../dimcm.properties"));
baseurl = props.getString("baseurl");
cache.put(CACHE_BASEURL, baseurl);
return baseurl;