download remote machine files using java
I would like to download somefiles which is in remote shared folder from the local system using java code. Can you please guide us, how i can proceed this. Whether i need use http or ftp. But i want to execute the code only in the local machine. It should not like client server program. Please post some tips over here.
Thanks in advan开发者_Go百科ce.
You cannot solve this without knowing the platform of your machine (where the app runs) and remote machine. But once you know you have many possibilities.
Agent full solution
Install agent on remote machine. The agent should expose API that allows access to the files. For example you can use FTP server as an agent. Then access this server and download your files. Alternatively you can implement your own application or servlet running in one of available servlet containers and provide access to files over HTTP.
Agent-less solution
Use the built-in functionality of target machine. For example use SSH to connect to Unix machine and SMB for windows. Both support Telnet You can use VFS package from jakarta. There are several implementations of SSH. I recommend JSH.
精彩评论