Yes, if you're reading the stdout stream. Here's a runtime exec exercise I did. It's not 100% bug free: http://www.surfscranton.com/architecture/CmdServer.htm The server portion has the runtime exec stuff. Have you looked around for FTP APIs for Java? I've seen some open source or free packages mentioned but never tried any. That would give you the best possible control over FTP. This ...
URL url = new URL("ftp://admin:administrator@10.20.30.9"); URLConnection urlc = url.openConnection(); InputStreamReader isr = new InputStreamReader(urlc.getInputStream()); Process process = Runtime.getRuntime().exec(urlc + "cd SABB_APP dir"); BufferedReader input = new BufferedReader(isr); String s; while ((s = input.readLine()) != null) { System.out.println(s); }input.close(); I have done this thing for connection,but i want to execute mput and mget commands from java..I thought to use Runtime.getRuntime.exec() but was ...
URL url = new URL("ftp://admin:administrator@10.20.30.9"); URLConnection urlc = url.openConnection(); InputStreamReader isr = new InputStreamReader(urlc.getInputStream()); Process process = Runtime.getRuntime().exec(urlc + "cd SABB_APP dir"); BufferedReader input = new BufferedReader(isr); String s; while ((s = input.readLine()) != null) { System.out.println(s); }input.close(); I have done this thing for connection,but i want to execute mput and mget commands from java..I thought to use Runtime.getRuntime.exec() but was ...
I am trying to implement the SIZE command in FTP. The RFC says that the return value of the SIZE command will depend on the current STRUCTURE , MODE and TYPE of data connection. However, it doenot say how . I have not been able to find anything on the net either. Does anyone have a working implementation of the SIZE ...