简体   繁体   中英

Java Remote File Options

I've recently started an internship and I'm having some issues with Java in the enterprise environment. I've been assigned the task of porting the functionality of an old windows shell script to java so it may be ran on one of our JVMs.

The shell script runs on one of the Windows servers and grabs the previous days log files from a couple of linux boxes then FTPs them to another Windows machine.

I'm not quite sure how to achieve this functionality using java. I only can SSH into the linux boxes. I have got the connection working for the Windows file share, just not sure of the best way to connect to the linux boxes.

I've considered using one of the SSH libraries, but would prefer to avoid using a third party library.

Any insight would be great. Thanks!

Java development is all about the appropriate use of third-party libraries. You can try and avoid it, but you won't get anywhere.

I suggest using JSch for your SSH/SCP/SFTP needs.

You're looking for SFTP. Look at How to retrieve a file from a server via SFTP? .

尝试使用SCP(FTP风格的文件传输方式,但使用SSH)从Linux传输文件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM