This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Best way to read a remote file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Best way to read a remote file" Watch "Best way to read a remote file" New topic
Author

Best way to read a remote file

Peter Straw
Ranch Hand

Joined: Jan 08, 2002
Posts: 79
Please can you tell me the best way to read a log file on a remote linux machine. I really just need to check that the file is empty.
Many thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41033
    
  43
What kind of access do you have to that machine - FTP, HTTP, NFS, SMB, Telnet, SSH, ... ?


Ping & DNS - my free Android networking tools app
Peter Straw
Ranch Hand

Joined: Jan 08, 2002
Posts: 79
Hi Ulf,

It's ssh, possibly telnet and http, but doing it by ssh would be best.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41033
    
  43
There are a number of Java SSH libraries, e.g. sshtools and JSch.
 
Consider Paul's rocket mass heater.
 
subject: Best way to read a remote file
 
Similar Threads
Option tor read FTP file to string variable.
can you
files
doPost() vs doPut()
Serializing a file over RMI