protected void sendFile(String path, String name, String data) throws Exception {
ChannelExec c = (ChannelExec) session.openChannel("exec");
c.setCommand("scp -t " + path);
OutputStream os = c.getOutputStream();
InputStream is = c.getInputStream();
c.connect();
assertEquals(0, is.read());
os.write(("C7777 "+ data.length() + " " + name + "\n").getBytes());
os.flush();
assertEquals(0, is.read());
os.write(data.getBytes());