@@ -0,0 +1,1737 @@
+package fi.nls.oskari;%0A%0Aimport org.apache.logging.log4j.LogManager;%0Aimport org.apache.logging.log4j.Logger;%0Aimport org.springframework.beans.factory.annotation.Value;%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.servlet.ModelAndView;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0A%0A/**%0A * Support for link redirects. Configuration in linkredirect.properties%0A *%0A * @see fi.nls.oskari.spring.SpringConfig%0A */%0A@Controller%0Apublic class FriendlyURLHandler %7B%0A%0A    @Value(%22$%7Bortophoto.url%7D%22)%0A    private String ortophotoUrl;%0A%0A    @RequestMapping(%22/historiallisetilmakuvat%22)%0A    public ModelAndView finnish(HttpServletRequest request) throws Exception %7B%0A        return ortophotos(%22fi%22, request);%0A    %7D%0A%0A    @RequestMapping(%22/sv/historiskaflygbilder%22)%0A    public ModelAndView swedish(HttpServletRequest request) throws Exception %7B%0A        return ortophotos(%22sv%22, request);%0A    %7D%0A%0A    @RequestMapping(%22/en/historicalorthophotos%22)%0A    public ModelAndView english(HttpServletRequest request) throws Exception %7B%0A        return ortophotos(%22en%22, request);%0A    %7D%0A%0A    public ModelAndView ortophotos(String lang, HttpServletRequest request) throws Exception %7B%0A        String url = attachQuery(ortophotoUrl, %22lang=%22 + lang);%0A        return new ModelAndView(%22redirect:%22 + attachQuery(url, request.getQueryString()));%0A    %7D%0A%0A    private String attachQuery(String path, String query) %7B%0A        if (query == null) %7B%0A            return path;%0A        %7D%0A        if (path.indexOf('?') == -1) %7B%0A            return path + %22?%22 + query;%0A        %7D%0A        if (path.endsWith(%22?%22)) %7B%0A            return path + query;%0A        %7D%0A        return path + %22&%22 + query;%0A%0A    %7D%0A%7D%0A

Add handler for ortophoto friendly url