Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sftp 1

Status
Not open for further replies.

Adkron

Programmer
Jun 6, 2005
39
US
Does anyone know of a free library to use sftp inside of java? I'm writing a webservice, and I must be able to get files from an sftp server, and send them out in an XML document. I know how to send a file with XML, but java doesn't seem to have an sftp protocal built in.

Amos
Computer Science
U of MO - Rolla
 
Believe me I have. Many times. I found quite a few libraries that I can pay thousands for, but nothing that is free or cheap. My boss is telling me that he wants me to use a windows command, and call it from java, but that will expose the password to the file location, which he doesn't want me to do, and it will limit the ability of my web API to only working under windows, and with something like pscp installed. There has been talk of encrypting the SOAP message that is passed to stop the password from being seen, but I'm not sure how to do that, and it will still leave the problem of only working under windows.

Amos
Computer Science
U of MO - Rolla
 
There are loads of examples of free SFTP - seriously - google for "SFTP Java".

Eg :

Write an FTP server (not hard) :
Wrap it in a SSL layer :
Or there are loads of others out there

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Thanks, and I appreciate this, but I already have an SFTP server. I am writing a web API that searches an Oracle Database, and retrieves a file location on an ftp server. it then searches for a password in the database, that is changed monthly. It takes this information and is supposed to get the file from the sftp server, and change it to a byte[] to put in an XML message that the client recieves. The problem is that the standard java libraries do not support sftp. They only support ftp. I need to be able to use the sftp protocol to get the file. The only libraries I can find that can utilize the sftp protocol are all very expensive, and currently I do not have the budget to purchase one. If the server is ftp I can get the files, and everything works great. The problem arises that I must be able to connect via sftp.

Amos
Computer Science
U of MO - Rolla
 
Once again ... this link (which I posted earlier) shows you how to wrap an FTP client within a SSL layer :
And I really must iterate again - there are LOADS of FREE FTP clients /FTP code out there - just google as I said before. I posted an example of one before !

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
thanks

Amos
Computer Science
U of MO - Rolla
 
I really hate to have to explain this, but ssl is NOT ssh. sftp uses ssh. ssl can be used to allow https but not sftp. There are loads of free sftp programs, and ftp. There are loads of free libraries to do ftp, but not sftp. Thank you, and good day.

Amos
Computer Science
U of MO - Rolla
 
It appears that actually it is a misconception that SFTP uses SSH .

wikipedia said:
A common misconception is that SFTP is simply FTP run over SSH; in fact it is a new protocol designed from the ground up by the IETF SECSH working group. [ ]


Adkron said:
There are loads of free libraries to do ftp, but not sftp
What about this one ? This sourceforge project is a Java API for SFTP aswell as SSH and other protocols.

Or this one ? That project also does SFTP, FTPS, and like the previous API is free !

I may have misread that FTPS was the same as SFTP, but there is no need to be rude. You come here for help - and I'm trying to help you. A simple google, as I have proven, will provide what you are looking for. So wow, I slightly misunderstood a protocol ? I *actually* give back to the community a lot via helping here (feel free to browse my profile), aswell as providing a free database pooling API. What do you do ? How do you give back to the open source community ?

So as you said earlier - Thank you and good night.



--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
I did your simple google search many times. I even decided, jut to humor you, I would copy your search.

Ok so starting with fresh meat.
If you follow the link you will find that is in fact, not free. I did find this in my searching, and here is the page with the licenses and prices:

The other link:
this is what I found about it before:
SSHTools is a suite of Java SSH applications providing a Java SSH Terminal, SSH secured VNC client, SFTP client and SSH Daemon.

Applications and libraries are not the same thing.

Thank you for your time, and your concern with "helping me" and "giving back to the community." If by telling me to search google you think you are helping the community you have a lot of problems. I did say thank you, but being rude about it doesn't really help. I would not come to a forum without searching google, and other engines. I'm sorry that some people do. You really shouldn't assume that a person would come without searching first. It takes longer to sift through crapy replies, and flames about searching google, than doing a google search in the first place.

Now I will say that I spend a lot of time on IRC, and forums helping out. I will say that I am not really a Java programmer. I'm really a C, C++, Perl, etc, guy. I have been asked by my boss to produce this in Java. I try to give back to the community in any way I can, Java is not the way I can. I have written programs for sattelite communications, and many database front ends. I have done my part to report bugs, and help people with Linux questions. I have also been porting and developing for the BlackDog Mobile Personal Server.

Didn't your mother ever tell you, "If you don't have something nice to say, don't say it at all?" Maybe you should think about thatt before posting. And, please, stop saying that by telling someone to search google that you are givingg back to the community.

Amos
Computer Science
U of MO - Rolla
 
Yeah, because every post I help on, I say "try google". Thats right.

Fair point on the freshmeat project - I missed that.

As for the other link - its open source - so I'm sure you could get out of it what you need. If you are an accomplished C++ programmer, I'm sure ripping through a bit of Java to take a look at the functionality you need is not beyond your skills.

Or take a look at the link Dian gave ...

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Diancecht,
Thanks for the length, but that is JCraft that they are talking about, and unfortunately it only has a 45 day trial, and is not free past that. I got around the problem by placing my function on the server, and now I just have to figure out WSDL and jaxRPC so I can get at it. That is what happens when your boss is a cartographer and not a programer. He keeps changing his mind, and has no realy idea what he wants. He now wants a WSDL so that outside programers can get at the function. I think it's great, but I wish he would have done that earlier. It would have saved me a lot of trouble.

Sedj,
Sorry that I got so mad when you told me to try google. I normally just say I did and move on. I'm a little upset with my boss changing his mind all the time, and my wife is pregnant and getting close to having our child. This is my first, and her second. We have already been to the hospital once, but after four hours they said she stopped progressing, and we should just go home. I'm just stressed. Sorry.

Amos
Computer Science
U of MO - Rolla
 
Sorry I was wrong about JCraft. I was confusing it with JScape's product.

Amos
Computer Science
U of MO - Rolla
 
OK, no probs fella. I'm sorry I mistook you for a lazy leacher, when you clearly are not, but just need a quick solution.
Hope all goes well with the new born :)

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top