Class FTP5250Prot


  • public class FTP5250Prot
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      FTP5250Prot​(tnvt v)  
    • Method Summary

      Modifier and Type Method Description
      void addFTPStatusListener​(FTPStatusListener listener)
      Add a FTPStatusListener to the listener list.
      boolean connect​(java.lang.String host, int port)
      Set up ftp sockets and connect to an as400
      void disconnect()
      Send quit command to ftp server and close connections
      java.lang.String getFieldName​(int which)
      Convenience method to return the name of a field
      protected boolean getFile​(java.lang.String remoteFile, java.lang.String localFile)
      Transfer the file information to an output file
      protected boolean getFileInfo​(java.lang.String tFile, boolean useInternal)
      Retrieves the File Field Definitions and Member information for the remote file to be transferred
      int getFileSize()
      Convenience method to return the file size of the file and member that is being transferred
      java.lang.String getFullFileName​(java.lang.String tFile)
      Convenience method to return the file name and member that is being transferred
      protected boolean getMbrInfo​(java.lang.String file, java.lang.String member)
      Executes the command to obtain the member information of the remote file
      int getNumberOfFields()
      Returns the number of fields in the File Field Definition array of fields returned from the DSPFFD command
      boolean isConnected()
      returns whether or not the system is connected to an AS400 or not
      boolean isFieldSelected​(int which)
      Returns whether a field is selected for output or not
      boolean isFieldsSelected()
      Returns whether there are any fields selected or not
      boolean login​(java.lang.String user, java.lang.String passWord)
      Send the user id and password to the connected host
      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
      protected boolean printHelp()
      Print output of the help command Not used just a test method for me
      void removeFTPStatusListener​(FTPStatusListener listener)
      Remove a FTPStatusListener from the listener list.
      protected void selectAll()
      Select all the fields for output
      protected void selectNone()
      Unselect all fields for output.
      void setAborted()
      Abort the current file transfer
      void setDecimalChar​(char dec)  
      void setFieldSelected​(int which, boolean value)
      Convenience method to select or unselect a field for output
      void setOutputFilter​(OutputFilterInterface o)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FTP5250Prot

        public FTP5250Prot​(tnvt v)
    • Method Detail

      • 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 hostname
        port - 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 name
        passWord - 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 number
        value - 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 - file
        useInternal - 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 - file
        member - 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 - file
        localFile - file
        Returns:
        flag
      • setAborted

        public void setAborted()
        Abort the current file transfer