(defn ssh-sftp-cmd
"Command on a ftp channel."
[#^ChannelSftp channel cmd args options]
(condp = cmd
:ls (.ls channel (or (first args) "."))
:cd (.cd channel (first args))
:lcd (.lcd channel (first args))
:chmod (.chmod channel (first args) (second args))
:chown (.chown channel (first args) (second args))
:chgrp (.chgrp channel (first args) (second args))
:pwd (.pwd channel)
:lpwd (.lpwd channel)
:rm (.rm channel (first args))
:rmdir (.rmdir channel (first args))
:rmdir (.mkdir channel (first args))
:stat (.stat channel (first args))
:lstat (.lstat channel (first args))
:rename (.rename channel (first args) (second args))
:symlink (.symlink channel (first args) (second args))
:readlink (.readlink channel (first args))
:realpath (.realpath channel (first args) (second args))
:get-home (.getHome channel)
:get-server-version (.getServerVersion channel)
:get-extension (.getExtension channel (first args))
:get (let [args (if (options :with-monitor)
(conj args (options :with-monitor))
args)
args (if (options :mode)
(conj args (sftp-modemap (options :mode)))
args)]
((memfn-varargs get) channel args))
:put (let [args (if (options :with-monitor)
(conj args (options :with-monitor))
args)
args (if (options :mode)
(conj args (sftp-modemap (options :mode)))
args)]
((memfn-varargs put) channel args))
(throw (java.lang.IllegalArgumentException.
(str "Unknown SFTP command " cmd)))))
Used in 0 other vars
Comments top
No comments for ssh-sftp-cmd. Log in to add a comment.