Ejemplo n.º 1
0
  @RequestMapping(method = RequestMethod.GET, value = "/probarFuente/{id}/{tipo}")
  public ResponseEntity<EncapsuladorBooleanSW> probarFuente(
      @PathVariable("id") Long id, @PathVariable("tipo") String tipo, HttpServletRequest request) {
    String path;
    String caracterSeparador = getServicioConfiguracionGeneral().getCaracterSeparadorCSV();

    if (tipo.equals(TiposFuente.CSV.getId())) path = getServicioConfiguracionGeneral().getPathCsv();
    else if (tipo.equals(TiposFuente.GML.getId()))
      path = getServicioConfiguracionGeneral().getPathGml();
    else if (tipo.equals(TiposFuente.SHAPEFILE.getId()))
      path = getServicioConfiguracionGeneral().getPathShapefile();
    else path = null;

    String realPath = getPathRealAplicacion(request, path);
    return new ResponseEntity<EncapsuladorBooleanSW>(
        gestorCUFuente.probarFuente(id, realPath, caracterSeparador),
        responseHeaders,
        HttpStatus.OK);
  }