package com.iamberry.app.international.controller;

import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("/test-download/")
public class ApkDownload extends BaseController {

	@RequestMapping(value = "test_iamberry_release.apk", method = RequestMethod.GET)
	@ResponseBody
	private void download(HttpServletResponse response, HttpServletRequest request) {
		try {
			response.sendRedirect("/download/iamberry_release_" + userService.getApkVersion() + ".apk");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
