Package org.tn5250j.tools
Class FTP5250Prot
- java.lang.Object
-
- org.tn5250j.tools.FTP5250Prot
-
public class FTP5250Prot extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FTP5250Prot(tnvt v)
-
Method Summary
Modifier and Type Method Description voidaddFTPStatusListener(FTPStatusListener listener)Add a FTPStatusListener to the listener list.booleanconnect(java.lang.String host, int port)Set up ftp sockets and connect to an as400voiddisconnect()Send quit command to ftp server and close connectionsjava.lang.StringgetFieldName(int which)Convenience method to return the name of a fieldprotected booleangetFile(java.lang.String remoteFile, java.lang.String localFile)Transfer the file information to an output fileprotected booleangetFileInfo(java.lang.String tFile, boolean useInternal)Retrieves the File Field Definitions and Member information for the remote file to be transferredintgetFileSize()Convenience method to return the file size of the file and member that is being transferredjava.lang.StringgetFullFileName(java.lang.String tFile)Convenience method to return the file name and member that is being transferredprotected booleangetMbrInfo(java.lang.String file, java.lang.String member)Executes the command to obtain the member information of the remote fileintgetNumberOfFields()Returns the number of fields in the File Field Definition array of fields returned from the DSPFFD commandbooleanisConnected()returns whether or not the system is connected to an AS400 or notbooleanisFieldSelected(int which)Returns whether a field is selected for output or notbooleanisFieldsSelected()Returns whether there are any fields selected or notbooleanlogin(java.lang.String user, java.lang.String passWord)Send the user id and password to the connected hostprotected voidprintDirListing()Print out the remote directory of the not used right now but maybe in the future to obtain a list of files to select for downloadprotected booleanprintHelp()Print output of the help command Not used just a test method for mevoidremoveFTPStatusListener(FTPStatusListener listener)Remove a FTPStatusListener from the listener list.protected voidselectAll()Select all the fields for outputprotected voidselectNone()Unselect all fields for output.voidsetAborted()Abort the current file transfervoidsetDecimalChar(char dec)voidsetFieldSelected(int which, boolean value)Convenience method to select or unselect a field for outputvoidsetOutputFilter(OutputFilterInterface o)
-
-
-
Constructor Detail
-
FTP5250Prot
public FTP5250Prot(tnvt v)
-
-
Method Detail
-
setOutputFilter
public void setOutputFilter(OutputFilterInterface o)
-
setDecimalChar
public void setDecimalChar(char dec)
-
connect
public boolean connect(java.lang.String host, int port)Set up ftp sockets and connect to an as400- Parameters:
host- a hostnameport- a port to connect to- Returns:
- flag
-
disconnect
public void disconnect()
Send quit command to ftp server and close connections
-
isConnected
public boolean isConnected()
returns whether or not the system is connected to an AS400 or not- Returns:
- flag
-
addFTPStatusListener
public void addFTPStatusListener(FTPStatusListener listener)
Add a FTPStatusListener to the listener list.- Parameters:
listener- The FTPStatusListener to be added
-
removeFTPStatusListener
public void removeFTPStatusListener(FTPStatusListener listener)
Remove a FTPStatusListener from the listener list.- Parameters:
listener- The FTPStatusListener to be removed
-
login
public boolean login(java.lang.String user, java.lang.String passWord)Send the user id and password to the connected host- Parameters:
user- The user namepassWord- The password of the user- Returns:
- flag
-
printDirListing
protected void printDirListing()
Print out the remote directory of the not used right now but maybe in the future to obtain a list of files to select for download
-
isFieldSelected
public boolean isFieldSelected(int which)
Returns whether a field is selected for output or not- Parameters:
which- number of field- Returns:
- flag
-
selectAll
protected void selectAll()
Select all the fields for output
-
selectNone
protected void selectNone()
Unselect all fields for output. This is a convenience method to unselect all fields for a file that will only need to output a couple of fields
-
isFieldsSelected
public boolean isFieldsSelected()
Returns whether there are any fields selected or not- Returns:
- flag
-
setFieldSelected
public void setFieldSelected(int which, boolean value)Convenience method to select or unselect a field for output- Parameters:
which- field numbervalue- flag
-
getFieldName
public java.lang.String getFieldName(int which)
Convenience method to return the name of a field- Parameters:
which- field number- Returns:
- string
-
getNumberOfFields
public int getNumberOfFields()
Returns the number of fields in the File Field Definition array of fields returned from the DSPFFD command- Returns:
- number
-
getFileInfo
protected boolean getFileInfo(java.lang.String tFile, boolean useInternal)Retrieves the File Field Definitions and Member information for the remote file to be transferred- Parameters:
tFile- fileuseInternal- flag- Returns:
- flag
-
getMbrInfo
protected boolean getMbrInfo(java.lang.String file, java.lang.String member)Executes the command to obtain the member information of the remote file- Parameters:
file- filemember- member- Returns:
- flag
-
getFullFileName
public java.lang.String getFullFileName(java.lang.String tFile)
Convenience method to return the file name and member that is being transferred- Parameters:
tFile- file- Returns:
- string
-
getFileSize
public int getFileSize()
Convenience method to return the file size of the file and member that is being transferred- Returns:
- size
-
printHelp
protected boolean printHelp()
Print output of the help command Not used just a test method for me- Returns:
- flag
-
getFile
protected boolean getFile(java.lang.String remoteFile, java.lang.String localFile)Transfer the file information to an output file- Parameters:
remoteFile- filelocalFile- file- Returns:
- flag
-
setAborted
public void setAborted()
Abort the current file transfer
-
-