a/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/utils/SSHManager.java b/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/utils/SSHManager.java
...
...
70
        ChannelSftp sftpChannel = (ChannelSftp) channel;
70
        ChannelSftp sftpChannel = (ChannelSftp) channel;
71
71
72
        File file = null;
72
        File file = null;
73
        try {
73
        try {
74
            file = File.createTempFile("tavernaExtractor-", ".input");
74
            file = File.createTempFile("tavernaExtractor-", ".input");
75
            //file.deleteOnExit();
76
        } catch (IOException e) {
75
        } catch (IOException e) {
77
            e.printStackTrace();
76
            e.printStackTrace();
78
            throw new SSHManagerException(e.getLocalizedMessage());
77
            throw new SSHManagerException(e.getLocalizedMessage());
79
        }
78
        }
80
79
...
...
83
        } catch (SftpException e) {
82
        } catch (SftpException e) {
84
            e.printStackTrace();
83
            e.printStackTrace();
85
            throw new SSHManagerException(e.getLocalizedMessage());
84
            throw new SSHManagerException(e.getLocalizedMessage());
86
        }
85
        }
87
86
87
       sftpChannel.disconnect();
88
        session.disconnect();
88
       session.disconnect();
89
        return file;
89
       return file;
90
    }
90
    }
91
91
92
    public void sendFile(Session session, String from, String to) throws SSHManagerException{
92
    public void sendFile(Session session, String from, String to) throws SSHManagerException{
93
93
94
        if(!session.isConnected()){
94
        if(!session.isConnected()){
...
...
119
            throw new SSHManagerException(e.getLocalizedMessage());
119
            throw new SSHManagerException(e.getLocalizedMessage());
120
        }
120
        }
121
121
122
        session.disconnect();
122
        session.disconnect();
123
    }
123
    }
124
125
    public static void main(String[] arg) throws Exception{
126
127
         SSHManager ssh = new SSHManager("172.16.1.3",22, "timbus", "timbus");
128
         Session session = ssh.createSession(60000);
129
130
         // downloading file
131
         File file = ssh.readFile(session, "/home/timbus/WorkflowInput/+Z150709801_ground_truth.csv");
132
         if(file!=null){
133
            System.out.println("File successfully saved at "+file.getAbsolutePath() + " [size="+file.length()+"]");
134
         }
135
136
        Thread.sleep(3000);
137
138
         // receiving file
139
         ssh.sendFile(session, new File("C:\\Users\\munterberger\\AppData\\Local\\Temp\\tavernaExtractor-7820989094280082735.input").getAbsolutePath(), "/home/timbus/WorkflowInput/tmp.csv");
140
    }
124
  }
141
142
}