# Class FTPClient

java.lang.Object
htsjdk.samtools.util.ftp.FTPClient

public class FTPClient extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`READ_TIMEOUT`

## Constructor Summary

Constructors
Constructor
Description
`FTPClient()`

## Method Summary

Modifier and Type
Method
Description
`FTPReply`
`binary()`
`void`
`closeDataStream()`
`FTPReply`
`connect(String host)`
Connects to the given FTP host on the default port.
`void`
`disconnect()`
Disconnects from the host to which we are currently connected.
`FTPReply`
`executeCommand(String command)`
Executes the given FTP command on our current connection, returning the three digit response code from the server.
`InputStream`
`getDataStream()`
`FTPReply`
`getReply()`
`FTPReply`
`login(String username, String password)`
Wrapper for the commands `user [username]` and `pass [password]`.
`FTPReply`
`pasv()`
`FTPReply`
`quit()`
`FTPReply`
`retr(String file)`
`void`
`setRestPosition(long position)`
`FTPReply`
`size(String file)`
Return the size of the remote file

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### READ_TIMEOUT

public static final int READ_TIMEOUT

See Also:
  - Constant Field Values

## Constructor Details

### FTPClient

public FTPClient()

## Method Details

### connect

public FTPReply connect(String host) throws IOException
Connects to the given FTP host on the default port.

Throws:
  `IOException`

### executeCommand

public FTPReply executeCommand(String command) throws IOException
Executes the given FTP command on our current connection, returning the three digit response code from the server. This method only works for commands that do not require an additional data port.

Throws:
  `IOException`

### login

public FTPReply login(String username, String password) throws IOException
Wrapper for the commands `user [username]` and `pass [password]`.

Throws:
  `IOException`

### quit

public FTPReply quit() throws IOException

Throws:
  `IOException`

### binary

public FTPReply binary() throws IOException

Throws:
  `IOException`

### pasv

public FTPReply pasv() throws IOException

Throws:
  `IOException`

### setRestPosition

public void setRestPosition(long position)

### retr

public FTPReply retr(String file) throws IOException

Throws:
  `IOException`

### getReply

public FTPReply getReply() throws IOException

Throws:
  `IOException`

### size

public FTPReply size(String file) throws IOException
Return the size of the remote file

Parameters:
  `file` -
Returns:
Throws:
  `IOException`

### getDataStream

public InputStream getDataStream() throws IOException

Throws:
  `IOException`

### closeDataStream

public void closeDataStream() throws IOException

Throws:
  `IOException`

### disconnect

public void disconnect()
Disconnects from the host to which we are currently connected.