It might be better to use "target" as destination directory and get the host from the configuration. Then, you can create the connection in the constructor and disconnect in the destructor, which saves the overhead of creating new connections if several files should be transfered