Subversion Repositories XServices

Compare Revisions

Ignore whitespace Rev 175 → Rev 188

/xservices/trunk/src/java/net/brutex/xservices/ws/rs/DIMCMInfoImpl.java
33,16 → 33,20
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;
 
 
/*
76,7 → 80,7
*/
public class DIMCMInfoImpl implements DIMCMInfo {
 
Logger logger = Logger.getLogger(DIMCMInfoImpl.class);
Logger logger = LogManager.getLogger();
 
/*
* (non-Javadoc)
93,7 → 97,7
/*
* try to hit cache first
*/
JCS cache = JCS.getInstance("DIMCM");
CacheAccess<Object, Object> cache = JCS.getInstance("DIMCM");
String cachekey = projSpec + directory + String.valueOf(recursive);
if(useCache) {
ItemTypeList cacheresult = (ItemTypeList) cache.get(cachekey);
328,7 → 332,8
*/
PropertiesConfiguration props;
try {
props = new PropertiesConfiguration(this.getClass()
props = new Configurations().properties(this.getClass()
.getClassLoader().getResource("/../dimcm.properties"));
} catch (ConfigurationException e) {
e.printStackTrace();
349,11 → 354,13
private String getBaseURL() {
final String CACHE_BASEURL = "DIMCM.conf.baseurl";
try {
JCS cache = JCS.getInstance("DIMCM");
CacheAccess<Object, Object> cache = JCS.getInstance("DIMCM");
String baseurl = (String) cache.get(CACHE_BASEURL);
if(baseurl != null) return baseurl;
PropertiesConfiguration props = new PropertiesConfiguration(this.getClass().getClassLoader().getResource("/../dimcm.properties"));
Configurations configs = new Configurations();
PropertiesConfiguration props = configs.properties((this.getClass().getClassLoader().getResource("/../dimcm.properties")));
baseurl = props.getString("baseurl");
cache.put(CACHE_BASEURL, baseurl);
return baseurl;