public class FTPDataSession extends Object implements Runnable
A data connection is made when a PORT or PASV FTP command is received on the main control session.
The PORT command will actively connect to the specified address/port on the client. The PASV command will create a listening socket and wait for the client to connect.
Modifier | Constructor and Description |
---|---|
protected |
FTPDataSession(FTPSrvSession sess)
Class constructor
|
protected |
FTPDataSession(FTPSrvSession sess,
InetAddress bindAddr)
Class constructor
|
protected |
FTPDataSession(FTPSrvSession sess,
InetAddress addr,
int port)
Class constructor
|
protected |
FTPDataSession(FTPSrvSession sess,
int localPort,
InetAddress bindAddr)
Class constructor
|
protected |
FTPDataSession(FTPSrvSession sess,
int localPort,
InetAddress addr,
int port)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
void |
abortTransfer()
Abort an in progress file transfer
|
void |
closeSession()
Close the data connection
|
protected int |
getAllocatedPort()
Return the port that was allocated to the data session
|
FTPSrvSession |
getCommandSession()
Return the associated command session
|
int |
getLocalPort()
Return the local port
|
InetAddress |
getPassiveAddress()
Return the passive server socket address
|
int |
getPassivePort()
Return the passive server socket port
|
Socket |
getSocket()
Return the data socket connected to the client
|
long |
getTransferByteCount()
Return the transfer byte count
|
boolean |
isTransferActive()
Determine if a file transfer is active
|
void |
run()
Run a file send/receive in a seperate thread
|
protected FTPDataSession(FTPSrvSession sess) throws IOException
Create a data connection that listens for an incoming connection.
sess
- FTPSrvSessionIOException
protected FTPDataSession(FTPSrvSession sess, int localPort, InetAddress bindAddr) throws IOException
Create a data connection that listens for an incoming connection on the specified network adapter and local port.
sess
- FTPSrvSessionlocalPort
- intbindAddr
- InetAddressIOException
protected FTPDataSession(FTPSrvSession sess, InetAddress bindAddr) throws IOException
Create a data connection that listens for an incoming connection on the specified network adapter.
sess
- FTPSrvSessionbindAddr
- InetAddressIOException
protected FTPDataSession(FTPSrvSession sess, InetAddress addr, int port)
Create a data connection to the specified client address and port.
sess
- FTPSrvSessionaddr
- InetAddressport
- intprotected FTPDataSession(FTPSrvSession sess, int localPort, InetAddress addr, int port)
Create a data connection to the specified client address and port, using the specified local port.
sess
- FTPSrvSessionlocalPort
- intaddr
- InetAddressport
- intpublic final FTPSrvSession getCommandSession()
public final int getLocalPort()
protected final int getAllocatedPort()
public final InetAddress getPassiveAddress()
public final int getPassivePort()
public final boolean isTransferActive()
public final void abortTransfer()
public final long getTransferByteCount()
public final Socket getSocket() throws IOException
IOException
public final void closeSession()
Copyright © 2005–2018 Alfresco Software. All rights reserved.