Skip to content
Snippets Groups Projects
Commit a839254b authored by William Enright's avatar William Enright Committed by Larbi Gharib
Browse files

Registering a license now reads for base64License field in a Json object

Change-Id: I31bed9ec4a5b79a3566df54104b8d56a4de5ef27
parent 0ef7a55a
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@ import net.jami.jams.common.objects.responses.SubscriptionStatusResponse;
import net.jami.jams.common.objects.user.AccessLevel;
import net.jami.jams.server.Server;
import net.jami.jams.server.licensing.LicenseService;
import org.json.JSONObject;
import java.io.FileWriter;
import java.io.IOException;
......@@ -58,6 +59,9 @@ public class SubscriptionServlet extends HttpServlet {
@ScopedServletMethod(securityGroups = {AccessLevel.ADMIN})
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
String license = new String(req.getInputStream().readAllBytes());
final JSONObject obj = new JSONObject(license);
license = obj.getString("base64License");
if(license != null || !license.isBlank()) {
// create .dat file to be used later
FileWriter fw = new FileWriter("license.dat");
......@@ -70,7 +74,6 @@ public class SubscriptionServlet extends HttpServlet {
return;
}
}
resp.setStatus(500);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment