Koha::File::Transport::SFTP - SFTP implementation of file transport
my $success = $self->connect;
Start the SFTP transport connect, returns true on success or undefined on failure.
my $success = $transport->upload_file($fh);
Passed a filehandle, this will upload the file to the current directory of the server connection.
Returns true on success or undefined on failure.
my $success = $transport->download_file($filename);
Passed a filename, this will download the file from the current directory of the server connection.
Returns true on success or undefined on failure.
my $success = $server->change_directory($directory);
Passed a directory name, this will change the current directory of the server connection.
Returns true on success or undefined on failure.
my $files = $server->list_files;
Returns an array reference of hashrefs with file information found in the current directory of the server connection. Each hashref contains: filename, longname, a (attributes).
my $success = $server->rename_file($old_name, $new_name);
Renames a file on the server connection.
Returns true on success or undefined on failure.
$server->disconnect();
Disconnects from the SFTP server.
$server->post_store_trigger;
Local trigger run by the parent store method after storage. Ensures key_file also gets written to the filesystem.
my $success = $server->_write_key_file;
Writes the keyfile from the db into a file.
Returns 1 on success, undef on failure.
my $path = $server->_locate_key_file;
Returns the keyfile's path if it exists, undef otherwise.
Helper method to abort the current operation and return.
Ensure proper cleanup of open filehandles