public class FTPDataSession
extends java.lang.Object
implements java.lang.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,
java.net.InetAddress bindAddr)
Class constructor
|
protected |
FTPDataSession(FTPSrvSession sess,
java.net.InetAddress addr,
int port)
Class constructor
|
protected |
FTPDataSession(FTPSrvSession sess,
int localPort,
java.net.InetAddress bindAddr)
Class constructor
|
protected |
FTPDataSession(FTPSrvSession sess,
int localPort,
java.net.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
|
java.net.InetAddress |
getPassiveAddress()
Return the passive server socket address
|
int |
getPassivePort()
Return the passive server socket port
|
java.net.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 java.io.IOException
Create a data connection that listens for an incoming connection.
sess
- FTPSrvSessionjava.io.IOException
protected FTPDataSession(FTPSrvSession sess, int localPort, java.net.InetAddress bindAddr) throws java.io.IOException
Create a data connection that listens for an incoming connection on the specified network adapter and local port.
sess
- FTPSrvSessionlocalPort
- intbindAddr
- InetAddressjava.io.IOException
protected FTPDataSession(FTPSrvSession sess, java.net.InetAddress bindAddr) throws java.io.IOException
Create a data connection that listens for an incoming connection on the specified network adapter.
sess
- FTPSrvSessionbindAddr
- InetAddressjava.io.IOException
protected FTPDataSession(FTPSrvSession sess, java.net.InetAddress addr, int port)
Create a data connection to the specified client address and port.
sess
- FTPSrvSessionaddr
- InetAddressport
- intprotected FTPDataSession(FTPSrvSession sess, int localPort, java.net.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 java.net.InetAddress getPassiveAddress()
public final int getPassivePort()
public final boolean isTransferActive()
public final void abortTransfer()
public final long getTransferByteCount()
public final java.net.Socket getSocket() throws java.io.IOException
java.io.IOException
public final void closeSession()
public void run()
run
in interface java.lang.Runnable
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.