2013年9月13日星期五

java linux server remote connection and read the file size

java remote connection linux, and read the given path, given the size of the file extension
looks like an application to read files on the host can get to the File object , and then get the size ;
but the landing to a non- host , you get less than a File object , and only use java call linux command "ls-l *. xx" approach , the results of its command and then io operations read the file size .

I ask is that right ?
There is no efficient solution? Log in remote linux I use ganymed-ssh2-build210.jar
------ Solution ------------------------ --------------------
using ftp it , ...........
------ Solution - ------------------------------------------
org.apache.commons . net.ftp.FTPClient, look at this , .........
------ For reference only ------------------ ---------------------
online ah. . . . . . . .
------ For reference only -------------------------------------- -
org.apache.commons.net.ftp.FTPClient really good
But this is the bank's monitoring function , their servers will not just install ftp ftp or log in
so it can only operate with the io
------ For reference only -------------------------- -------------
landlord I also encountered the same problem , but also with the ganymed-ssh2-build210.jar, I want to get File content. . . . . But do not know how to obtain , it is not get to the ah
------ For reference only -------------------------- -------------
buddy, I also encountered the demand just like you , to ask you finally, how to solve , thank you !
------ For reference only -------------------------------------- -
I have encountered such a demand , I ask you heroes not any solution ?
------ For reference only --------------- ------------------------
how you are going to board , I used ganymed-ssh2-build210.jar, but has not log on .
------ For reference only -------------------------------------- -
can log in , private void connection (String ip, int port, String user, String password) throws Exception {
conn = new Connection (ip, port);
conn.connect ();
boolean isAuthenticated = conn.authenticateWithPassword (user, password);
if (isAuthenticated == false) {
throw new IOException ("Authentication failed.");
}



}
------ For reference only --------------------------------- ------
how to get the file contents ? Anybody know?
------ For reference only -------------------------------------- -
with cat / xxx / xxx.txt can read the contents of the file , but only in order to read , what command only reads the new additions ? Anybody know?
------ For reference only -------------------------------------- -
I have encountered such a demand are learning . . .

没有评论:

发表评论