Java Reference
In-Depth Information
HttpEntity entity = response.getEntity();
String stockPrices = IOUtils.toString(entity.getContent());
stockPrices = StringUtils.strip(stockPrices);
if(stockPrices != null && stockPrices.length() > 0) {
return stockPrices;
} else {
return null;
}
}
private String buildQueryString() throws Exception {
List<String> tickers = tickersDao.getTickersPaged(curPage, pageSize);
if(tickers == null || tickers.size() == 0) {
return null;
}
StringBuilder tickerList = new StringBuilder("s=");
for (String ticker : tickers) {
tickerList.append(ticker + "+");
}
tickerList = new StringBuilder(tickerList.substring(0, tickerList.length() - 1));
return tickerList.append("&f=sl1").toString();
}
public void close() throws ItemStreamException {
}
public void open(ExecutionContext executionContext) throws ItemStreamException {
if(executionContext.containsKey("step2.tickers.page")) {
curPage = (Integer) executionContext.get("step2.tickers.page");
} else {
executionContext.put("step2.tickers.page", curPage);
}
}
public void update(ExecutionContext executionContext) throws ItemStreamException {
executionContext.put("step2.tickers.page", curPage);
curPage++;
}
public void setTickersDao(TickerDao tickersDao) {
this.tickersDao = tickersDao;
}
public void setHost(String host) {
this.host = host;
}
Search WWH ::




Custom Search