Conversation
Adds java example
Add a Node.js code snippet
C# SFTP Client
motymichaely
left a comment
There was a problem hiding this comment.
@bullheadandplato Thanks for your contribution. Can you please review the requested changes? Thanks!
| // 1) Paste this code into a new file (Sftp.java) | ||
| // | ||
| // 2) Install dependencies | ||
| // ./gradlew build |
There was a problem hiding this comment.
@bullheadandplato - gradlew is not an available utility by default. Please add some instructions on installing gradle in order for it to be available for those that just use this snippet.
| // ./gradlew build | ||
| // | ||
| // 3) Run the script | ||
| // ./gradlew run --args="<host> <port> <username> <password>" |
There was a problem hiding this comment.
@bullheadandplato Our snippets use SFTPTOGO_URL to parse the required parameters to connect. So I would like the command to run to be something like ./gradlew run and change the main function to parse environment variable like we do in other snippets. For instance: https://github.com/crazyantlabs/sftptogo-examples/blob/main/snippets/nodejs/ssh2/sftp.js.mustache#L89
There was a problem hiding this comment.
@motymichaely Can you please share the details about what can be the value of SFTPTOGO_URL? Thanks
There was a problem hiding this comment.
Yes:
sftp://username:password@host
Port should be 22 by default.
|
|
||
| public class Sftp { | ||
| public static void main(String[] args) { | ||
| var host = args[0]; |
There was a problem hiding this comment.
@bullheadandplato Please review the comment on running the snippet, and make sure we parse an environment variable named SFTPTOGO_URL that defaults to a mustache variable named {{ URI }}. The variable will have the full URI to connect to the server. If Port number is not provided in the URI, default port should be port 22.
|
@bullheadandplato - Can you please review? |
No description provided.