<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="com.jcraft.jsch.*"%>
<%@page import="ssh.*, scp.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        
      <!--scp file="c://proba.txt" todir="szegedil@halg.inf.unieb.hu:/home/szegedil" password="Hello02"/-->
      <%  SshConnect ssh = (SshConnect) session.getAttribute("ssh");
            String psw = ssh.password;
            String user = ssh.username;
            String host = ssh.hostname;
            String file = request.getParameter("file");
            file = file.substring(0, file.lastIndexOf("\\"));
            String[] result = request.getParameter("feladat_szam").toString().split("/");
            String fsor = result[1];
            String fszam = result[2];
            ssh.createDir(request.getParameter("feladat_szam").toString());
            String arg = user+":"+psw+"@"+host+":/home/"+user+"/"+fsor+"/"+fszam;
       %>
            
            <%= runScp.run(arg, file) %>
              
      
    </body>
</html>

