Skip to content
Snippets Groups Projects
Commit 58725184 authored by A C's avatar A C
Browse files

02-09Domain

parent d604e517
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,9 @@ import com.sun.net.httpserver.HttpPrincipal;
import java.io.*;
import java.util.*;
import org.json.JSONException;
import java.net.URI;
import java.net.URL;
import java.net.URLDecoder;
......@@ -82,7 +85,8 @@ public class DeleteHandler implements HttpHandler{
return;
}
if (!d.getUsers().contains(s)) {
ArrayList<String> ad= DBC.getDomainsAdmin(dominio);
if (!ad.contains(user)) {
// he.sendResponseHeaders(401,0 );
System.out.println("NON AUTORIZZATO");
response = "NON AUTORIZZATO";
......@@ -107,6 +111,10 @@ public class DeleteHandler implements HttpHandler{
// TODO Auto-generated catch block
e.printStackTrace();
} //finally {return;}idem qui
catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
......@@ -132,7 +140,7 @@ public class DeleteHandler implements HttpHandler{
URL url = new URL("http://127.0.0.1:3000");//maybe, se CloudAppe è in localhost porta 8080
URL url = new URL("http://127.0.0.1:3002");//maybe, se CloudAppe è in localhost porta 8080
//aggiungere 3000/delete
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
......
......@@ -120,7 +120,7 @@ public class InstallHandler implements HttpHandler {
// https://www.dir.uniupo.it/pluginfile.php/948883/mod_resource/content/1/FrameworkProgetto5.pdf
//
// http://127.0.0.1:8080/install
URL url = new URL("http://127.0.0.1:3000");// maybe, se CloudAppe è in localhost porta 8080
URL url = new URL("http://127.0.0.1:3002");// maybe, se CloudAppe è in localhost porta 8080
HttpURLConnection con = (HttpURLConnection) url.openConnection();
// 3000/install da inserire
con.setRequestMethod("POST");
......
......@@ -115,7 +115,7 @@ public class StartHandler implements HttpHandler {
e.printStackTrace();
}
URL url = new URL("http://localhost:3000/start");// maybe, se CloudApp è in localhost porta 8080
URL url = new URL("http://localhost:3002/start");// maybe, se CloudApp è in localhost porta 8080
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
......
......@@ -123,7 +123,7 @@ public class StopHandler implements HttpHandler {
// https://www.dir.uniupo.it/pluginfile.php/948883/mod_resource/content/1/FrameworkProgetto5.pdf
//
// http://127.0.0.1:8080/install
URL url = new URL("http://127.0.0.1:3000/stop");// maybe, se CloudAppe è in localhost porta 8080
URL url = new URL("http://127.0.0.1:3002/stop");// maybe, se CloudAppe è in localhost porta 8080
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment