Apache JMeter
2.0.1.20050615

org.apache.jmeter.protocol.ftp.sampler
Class FtpClient

java.lang.Object
  extended byorg.apache.jmeter.protocol.ftp.sampler.FtpClient

public class FtpClient
extends Object

Simple FTP client (non-passive transfers don't work yet). Kind of a hack, lots of room for optimizations.

Version:
$Revision: 1.8 $ Last updated: $Date: 2004/02/11 23:59:31 $
Author:
mike Created August 31, 2001

Nested Class Summary
 class FtpClient.dataGrabber
          Grabs the data from the dataport.
 
Constructor Summary
FtpClient()
          Constructor for the FtpClient object.
 
Method Summary
 void connect(String host, String username, String password)
          Connect to server.
 void disconnect()
          Disconnect from the server
 String get(String file)
          Get a file from the server.
static int getLower(int port)
          Gets the Lower attribute of the FtpClient class.
static int getPort(int upper, int lower)
          Gets the Port attribute of the FtpClient class.
 String getResponse()
          Get a file from the server.
static int getUpper(int port)
          Gets the Upper attribute of the FtpClient class.
 void send(String command)
          Send a command to the server.
 void setPassive(boolean flag)
          Set passive mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FtpClient

public FtpClient()
Constructor for the FtpClient object.

Method Detail

setPassive

public void setPassive(boolean flag)
Set passive mode.

Parameters:
flag - the new Passive value

getResponse

public String getResponse()
                   throws IOException
Get a file from the server.

Returns:
the Response value
Throws:
IOException

get

public String get(String file)
           throws Exception
Get a file from the server.

Throws:
Exception

connect

public void connect(String host,
                    String username,
                    String password)
             throws Exception
Connect to server.

Throws:
Exception

disconnect

public void disconnect()
Disconnect from the server


send

public void send(String command)
          throws IOException
Send a command to the server.

Throws:
IOException

getPort

public static int getPort(int upper,
                          int lower)
Gets the Port attribute of the FtpClient class.

Returns:
the Port value

getUpper

public static int getUpper(int port)
Gets the Upper attribute of the FtpClient class.

Returns:
the Upper value

getLower

public static int getLower(int port)
Gets the Lower attribute of the FtpClient class.

Returns:
the Lower value

Apache JMeter
2.0.1.20050615

Copyright © 1998-2005 Apache Software Foundation. All Rights Reserved.