home *** CD-ROM | disk | FTP | other *** search
- package sun.net.ftp;
-
- import java.io.IOException;
- import sun.net.NetworkClient;
-
- public class IftpClient extends FtpClient {
- public static final int IFTP_PORT = 4666;
- String proxyServer = "sun-barr";
- String actualHost;
-
- public void openServer(String var1) throws IOException {
- if (!((NetworkClient)this).serverIsOpen()) {
- super.openServer(this.proxyServer, 4666);
- }
-
- this.actualHost = var1;
- }
-
- boolean checkExpectedReply() throws IOException {
- return ((FtpClient)this).readReply() != FtpClient.FTP_ERROR;
- }
-
- public void login(String var1, String var2) throws IOException {
- if (!((NetworkClient)this).serverIsOpen()) {
- throw new FtpLoginException("not connected to host");
- } else {
- var1 = var1 + "@" + this.actualHost;
- super.user = var1;
- super.password = var2;
- if (((FtpClient)this).issueCommand("USER " + var1) != FtpClient.FTP_ERROR && (super.lastReplyCode != 220 || this.checkExpectedReply())) {
- if (var2 != null && ((FtpClient)this).issueCommand("PASS " + var2) == FtpClient.FTP_ERROR) {
- throw new FtpLoginException("password");
- }
- } else {
- throw new FtpLoginException("user");
- }
- }
- }
-
- public void setProxyServer(String var1) throws IOException {
- if (((NetworkClient)this).serverIsOpen()) {
- ((FtpClient)this).closeServer();
- }
-
- this.proxyServer = var1;
- }
-
- public IftpClient(String var1) throws IOException {
- this.openServer(var1);
- }
-
- public IftpClient() {
- }
- }
-