Android Open Source - bike-friend Load Station Data Job

From Project

Back to project page bike-friend.


The source code is released under:

GNU General Public License

If you think the Android project bike-friend listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.lemoulinstudio.bikefriend.webapp.quartz;
// w  ww .  ja va2 s .  co m
import com.lemoulinstudio.bikefriend.webapp.StationParser;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

 * @author Vincent Cantin
public class LoadStationDataJob extends QuartzJobBean {
  private Client jerseyClient;
  public LoadStationDataJob() {
    ClientConfig jerseyClientConfig = new DefaultClientConfig();
    this.jerseyClient = Client.create(jerseyClientConfig);

  private StationParser[] stationParserList;

  public void setStationParserList(StationParser[] stationParserList) {
    this.stationParserList = stationParserList;

  protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
    for (StationParser stationParser : stationParserList) {
      WebResource webResource = jerseyClient.resource(stationParser.getDataSourceUri());
      try (InputStream inputStream = webResource.get(InputStream.class)) {
      catch (Exception e) {}

Java Source Code List