Skip to content

Commit

Permalink
Add method comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
svenmueller committed Mar 12, 2014
1 parent 029acff commit 8cbe6fd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/coffee/sftphelpers.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ class SftpHelpers
@username = options.username
@password = options.password

###
Get directory entries.
@param {object} sftp SFTP handle.
@param {string} Directory to get the entries from.
@return Promise
###
listFiles: (sftp, dirName) ->
deferred = Q.defer()

Expand All @@ -34,6 +40,13 @@ class SftpHelpers
saveFile: (path, fileName, content) ->
# TODO

###
Downloads a file.
@param {object} sftp SFTP handle.
@param {string} remotePath Path of the remote file.
@param {string} localPath Download file to this path.
@return Promise
###
getFile: (sftp, remotePath, localPath) ->
deferred = Q.defer()

Expand All @@ -44,6 +57,10 @@ class SftpHelpers
deferred.resolve()
deferred.promise

###
Starts an SFTP session.
@return Promise
###
openSftp: ->
deferred = Q.defer()

Expand Down Expand Up @@ -72,6 +89,10 @@ class SftpHelpers

deferred.promise

###
Close SFTP session and underlying connection.
@return Promise
###
close: (sftp) ->
if sftp
sftp.end()
Expand Down

0 comments on commit 8cbe6fd

Please sign in to comment.