Subversion Repositories SmartDukaan

Rev

Rev 1453 | Rev 1455 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1453 Rev 1454
Line 23... Line 23...
23
import in.shop2020.thrift.clients.CatalogServiceClient;
23
import in.shop2020.thrift.clients.CatalogServiceClient;
24
import in.shop2020.thrift.clients.TransactionServiceClient;
24
import in.shop2020.thrift.clients.TransactionServiceClient;
25
import in.shop2020.thrift.clients.UserContextServiceClient;
25
import in.shop2020.thrift.clients.UserContextServiceClient;
26
import in.shop2020.thrift.clients.config.ConfigClient;
26
import in.shop2020.thrift.clients.config.ConfigClient;
27
 
27
 
-
 
28
import org.apache.log4j.Logger;
28
import org.apache.thrift.TException;
29
import org.apache.thrift.TException;
29
 
30
 
30
public class Utils {
31
public class Utils {
31
	//FIXME: Read this path from the config server
32
	private static Logger log = Logger.getLogger(Utils.class);
-
 
33
	
32
	public static final String EXPORT_ENTITIES_PATH = getExportPath();
34
	public static final String EXPORT_ENTITIES_PATH = getExportPath();
33
	
35
	
34
	private static String getExportPath(){
36
	private static String getExportPath(){
35
		String exportPath;
37
		String exportPath;
36
		ConfigClient client = ConfigClient.getClient();
38
		ConfigClient client = ConfigClient.getClient();
37
		try{
39
		try{
38
			exportPath = client.get("export_entities_path");
40
			exportPath = client.get("export_entities_path");
39
		}catch(ConfigException ce){
41
		}catch(ConfigException ce){
-
 
42
			log.error(ce);
40
			exportPath = "/var/lib/tomcat6/webapps/export/html/entities/";
43
			exportPath = "/var/lib/tomcat6/webapps/export/html/entities/";
41
		}
44
		}
42
		return exportPath;
45
		return exportPath;
43
	}
46
	}
44
	
47