"Cannot find symbol" errors in Java
Hey, I am making a "simple" FTP Client and, through reading and learning the basics, I have seemingly gotten through most of the simple things. Currently, I am getting compiling errors (Cannot find symbol) in the code shown below, mostly related to the FTPCommand variables in each method below and two others related to the "myIP = myInet.getHostAddress();", "connect(hostname, _defaultPort_);" and "__modes.substring(fileType, fileType + 1));" lines with the bold areas being where the arrow is pointing.
From what I've read, I think I must declare the variables, but when I do that or attempt to, I get more errors. I appreciate the help and responses. Thanks.
Quote:
import java.net.*;
import java.io.*;
import java.lang.*;
import java.io.IOException;
import java.net.InetAddress;
import org.apache.commons.net.SocketClient;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTP;
public class UIAgent {
public static void main(String argv[]) throws Exception {
}
// Connect to FTP Server
public static InetAddress getLocalHost() throws UnknownHostException
{
InetAddress myInet;
myInet = InetAddress.getLocalHost();
}
public String getHostAddress()
{
String myIP;
myIP = myInet.getHostAddress();
}
public void connect(String hostname) throws SocketException, IOException
{
connect(hostname, _defaultPort_);
System.out.println("CONNECT accepted for FTP server at host and port");
}
public int user(String username) throws IOException
{
return sendCommand(FTPCommand.USER, username);
}
public int pass(String password) throws IOException
{
return sendCommand(FTPCommand.PASS, password);
}
public int syst() throws IOException
{
return sendCommand(FTPCommand.SYST);
}
public int type(int fileType) throws IOException
{
return sendCommand(FTPCommand.TYPE, __modes.substring(fileType, fileType + 1));
}
// Get file from the FTP Server
public int retr(String pathname) throws IOException
{
return sendCommand(FTPCommand.RETR, pathname);
}
// Quit the FTP Server
public int quit() throws IOException
{
return sendCommand(FTPCommand.QUIT);
System.out.println("QUIT accepted, terminating FTP client");
}
}