1 package ch.busyboxes.agoo.controller;
2
3 import org.apache.log4j.Logger;
4 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.stereotype.Controller;
6 import org.springframework.ui.ModelMap;
7 import org.springframework.web.bind.annotation.RequestMapping;
8 import org.springframework.web.bind.annotation.RequestMethod;
9 import org.springframework.web.bind.annotation.RequestParam;
10
11 import ch.busyboxes.agoo.controller.model.WebWatchedFile;
12 import ch.busyboxes.agoo.service.WatchedFileService;
13
14
15
16
17
18
19 @Controller
20 public class FileController {
21
22
23 private Logger logger = Logger.getLogger(FileController.class);
24
25
26 private WatchedFileService watchedFileService;
27
28
29
30
31
32
33
34 @RequestMapping(value = "/file/details", method = RequestMethod.GET)
35 public ModelMap fileDetails(@RequestParam(value = "fileId") Long fileId) {
36 if (logger.isDebugEnabled()) {
37 logger.debug("Getting /file/details, with folderId: " + Long.toString(fileId));
38 }
39
40 ModelMap model = new ModelMap();
41 WebWatchedFile watchedFile = watchedFileService.getWatchedFileById(fileId);
42
43 model.addAttribute("watchedFile", watchedFile);
44
45 return model;
46 }
47
48
49
50
51
52
53 @Autowired
54 public void setWatchedFileService(WatchedFileService watchedFileService) {
55 this.watchedFileService = watchedFileService;
56 }
57 }