I urgently require a tip which will execute some simple unix commands (eg. "ls" or "cd" etc. )in a remote unix server where i have permissions (user id and passwd) .I am using the following code....
import sun.net.*;
import sun.net.ftp.*;
import java.io.*;
class myftp1
{
public static void main(String args[])
{
String site = "address of machine here";
String login = "abc";// **ENTER YOUR OWN Login
String password = "abc";// **ENTER YOUR PASSWORD
String fileToGet = "files.txt";
FtpClient fc;
TelnetInputStream tis;
TelnetOutputStream tos;
FileInputStream fis;
FileOutputStream fos;
try
{
fc = new FtpClient(site);/* connect to site */
/* print the site's response */
System.out.println(fc.getResponseString());
/* send login and password */
fc.login(login,password);
/* print the site's response */
System.out.println(fc.getResponseString());
tis = fc.get(fileToGet);
i want to execute the command from here .
Can anyone help..
Regards
import sun.net.*;
import sun.net.ftp.*;
import java.io.*;
class myftp1
{
public static void main(String args[])
{
String site = "address of machine here";
String login = "abc";// **ENTER YOUR OWN Login
String password = "abc";// **ENTER YOUR PASSWORD
String fileToGet = "files.txt";
FtpClient fc;
TelnetInputStream tis;
TelnetOutputStream tos;
FileInputStream fis;
FileOutputStream fos;
try
{
fc = new FtpClient(site);/* connect to site */
/* print the site's response */
System.out.println(fc.getResponseString());
/* send login and password */
fc.login(login,password);
/* print the site's response */
System.out.println(fc.getResponseString());
tis = fc.get(fileToGet);
i want to execute the command from here .
Can anyone help..
Regards