aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services/CheckAppVersionService.java
blob: 0fffb8a782eac3fdd34d8d17e685ce14f69da41b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package eu.siacs.conversations.services;

import com.google.gson.JsonObject;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class CheckAppVersionService extends HttpServlet {
    private static final long serialVersionUID = 1L;

    public CheckAppVersionService() {
        super();
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        doPost(request,response);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        PrintWriter out = response.getWriter();
        response.setContentType("text/html");

        //send a JSON response with the app Version and file URI
        JsonObject myObj = new JsonObject();
        myObj.addProperty("success", true);
        myObj.addProperty("latestVersionCode", 2);
        myObj.addProperty("latestVersion", "1.0.0");
        myObj.addProperty("appURI", "");
        out.println(myObj.toString());
        out.close();


    }

}