@@ -0,0 +1,2006 @@
+package org.network.Servelet;%0A%0A%0Aimport java.io.IOException;%0Aimport java.net.URLDecoder;%0A%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A%0A/**%0A * Servlet implementation class ServletHandle%0A */%0A@WebServlet(%22/ServletHandle%22)%0Apublic class ServletHandle extends HttpServlet %7B%0A%09private static final long serialVersionUID = 1L;%0A%09%0A%09private String csvFilePath = new String(%22%22);%0A    private NetworkDataAnalysis netTool = new NetworkDataAnalysis();%0A       %0A    public ServletHandle() %7B%0A    %7D%0A%0A    @Override%0A%09protected void doGet(HttpServletRequest request, HttpServletResponse response) %0A%09%09throws ServletException, IOException %7B%0A    %09%0A    %09// load original data%0A    %09if (request.getParameter(%22csv%22) != null) %7B%0A%09    %09String path = getClass().getClassLoader().getResource(%22%22).getPath();%0A%09    %09String fullPath = URLDecoder.decode(path, %22UTF-8%22);%0A%09    %09String pathArr%5B%5D = fullPath.split(%22/.metadata/.plugins%22);%0A%09    %09csvFilePath = pathArr%5B0%5D + %22/Final_Project_6893/WebContent/%22 + request.getParameter(%22csv%22);%0A%09    %09netTool.shutDown();%0A%09%09    netTool.createDb(csvFilePath);   %0A%09%09    %0A%09%09    response.sendRedirect(%22index.html%22);%0A    %09%7D %0A    %09// path find%0A    %09else if (request.getParameter(%22start%22) != null) %7B%0A    %09%09String startNode = request.getParameter(%22start%22);%0A    %09%09String endNode = request.getParameter(%22end%22);%0A        %09String output = netTool.getPath(Integer.parseInt(startNode),%0A%09%09%09%09%09%09%09%09%09%09%09Integer.parseInt(endNode));%0A        %09response.sendRedirect(%22index.html%22);%0A    %09%7D%0A    %09// cluster%0A    %09else %7B%0A    %09%09netTool.clustering();%0A    %09%7D%0A%09%7D%0A%0A%09/**%0A%09 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)%0A%09 */%0A%09protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException %7B%0A%09%09// TODO Auto-generated method stub%0A%09%7D%0A%0A    void exit() %7B%0A    %09netTool.shutDown();%0A    %7D%0A%09%0A%7D%0A

Create Gui.java