public void retrievePriceInfo(){
try {
URL priceInfo=new URL(PRICE_URL);
//open the URL connection to retrieve the price info.
InputStream in= priceInfo.openConnection().getInputStream();
if (in==null) {
logger.error("Open URL connection failed");
}
//get the current time.
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
this.setCurDate(df.format(new Date()));
//parse the retrieved data to get the price info.
try {
this.setPrice(IOUtils.toString(in,"UTF-8"));
} catch(Exception e) {
logger.error("parse price info failed."+e.getMe
try {
URL priceInfo=new URL(PRICE_URL);
//open the URL connection to retrieve the price info.
InputStream in= priceInfo.openConnection().getInputStream();
if (in==null) {
logger.error("Open URL connection failed");
}
//get the current time.
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
this.setCurDate(df.format(new Date()));
//parse the retrieved data to get the price info.
try {
this.setPrice(IOUtils.toString(in,"UTF-8"));
} catch(Exception e) {
logger.error("parse price info failed."+e.getMe