package com.imcode.imcms.servlet.apis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.ServletContext;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;

/**
 * Created by 3emluk on 29.07.16.
 */

@RestController
public class LinkController {

    @Autowired
    ServletContext servletContext;

    @RequestMapping(value = "/links", method = RequestMethod.GET)
    @ResponseBody
    public String getLinksConfigPath(){
        String fileString = "";
        try {
            fileString = new String(Files.readAllBytes(Paths.get(servletContext.getRealPath("/WEB-INF/conf/links.json"))), StandardCharsets.UTF_8);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return fileString;
    }

}

@@ -572,123 +572,377 @@
 luk 
-on 29.07.16.%0A */%0A%0A@RestController%0Apublic class LinkController %7B%0A%0A    @Autowired%0A    ServletContext servletContext;%0A
+for imCode from Ubranians on 29.07.16.%0A * Controller is used to redirect links information in JSON format to client%0A *%0A * @author 3emluk%0A */%0A%0A@RestController%0Apublic class LinkController %7B%0A%0A    @Autowired%0A    ServletContext servletContext;%0A%0A    /**%0A     * Send to client links information in JSON%0A     * @return JSON with links information provided at links.json%0A     */
 %0A   

Clean up of LinkController and adding documentation.