package it.digione.dg1cloud.controller;
|
|
import java.io.IOException;
|
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.servlet.ModelAndView;
|
|
import it.digione.dg1cloud.recaptcha.CaptchaSettings;
|
import it.digione.dg1cloud.recaptcha.DownloadFileCaptchaForm;
|
|
@Controller
|
public class DownloadPageController {
|
|
private static final Logger logger = LoggerFactory.getLogger(DownloadPageController.class);
|
|
@RequestMapping("/downloadPage")
|
public ModelAndView downloadPage(@RequestParam String fileName, @RequestParam long id,
|
@RequestParam(value = "secretKey", required = false) String secretKey) throws IOException {
|
|
logger.debug("Preparazione pagina download file {} con id {}", fileName, id);
|
|
DownloadFileCaptchaForm downloadParams = new DownloadFileCaptchaForm();
|
|
downloadParams.setFileName(fileName);
|
downloadParams.setId(id);
|
downloadParams.setSecretKey(secretKey);
|
|
ModelAndView modelAndView = new ModelAndView("downloadFileCaptcha");
|
modelAndView.addObject("downloadFileCaptchaForm", downloadParams);
|
|
return modelAndView;
|
}
|
}
|