Permalink
Browse files

sacado a un metodo a parte la carga de estaciones

  • Loading branch information...
gotoalberto committed Jan 25, 2012
1 parent 661ecd9 commit 7575ada967a07cc9e7de6e04c14f03b26f41a27d
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/main/java/com/opendata/trenconretraso/bulk/Load.java
@@ -30,15 +30,19 @@
@Override
public void onApplicationEvent(ContextRefreshedEvent arg0) {
+
+ cargarEstaciones();
+
+ }
+
+ private void cargarEstaciones(){
ClassPathResource estacionesResource = new ClassPathResource(estacionesFile);
- log.debug("CARGANDO EL CONTEXTO");
try{
InputStreamReader ir = new InputStreamReader(estacionesResource.getInputStream());
CSVReader reader = new CSVReader(ir,';');
String[] aux;
while ((aux = reader.readNext())!=null){
- log.debug("insertando estacion... " + aux[1]);
if(estacionService.findByCodEstacion("60400") == null){
Estacion estacion = new Estacion();
estacion.setCodigo(aux[0]);

0 comments on commit 7575ada

Please sign in to comment.