Class FCClientEngine

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.util.Observer, unlimited.core.transfers.io.FCClientEngineBridge, unlimited.core.transfers.TransferHandler, unlimited.core.transfers.UDPTransferMetrics, unlimited.core.util.common.version.KnowsRemoteServiceVersionInterface
    Direct Known Subclasses:
    FCClientEngineHTTP

    public class FCClientEngine
    extends java.lang.Object
    implements java.util.Observer, unlimited.core.transfers.UDPTransferMetrics, unlimited.core.util.common.version.KnowsRemoteServiceVersionInterface, unlimited.core.transfers.io.FCClientEngineBridge
    Supports client-side FileCatalyst operations The protocol used by FC (FileCatalyst client) is similar with FTP protocol
    • Field Detail

      • systemCache

        public static com.google.common.cache.Cache<java.lang.String,​java.lang.String> systemCache
      • readTimeoutLong

        protected int readTimeoutLong
      • UNABLE_TO_CONNECT_TO_NON_FILE_CATALYST_SERVER

        public static final java.lang.String UNABLE_TO_CONNECT_TO_NON_FILE_CATALYST_SERVER
        See Also:
        Constant Field Values
      • TOKEN_AUTH_SUCCESS_HEADER

        protected final java.lang.String TOKEN_AUTH_SUCCESS_HEADER
        See Also:
        Constant Field Values
      • isFileCatalystServerEnterprise

        protected boolean isFileCatalystServerEnterprise
      • isFileCatalystServerPro

        protected boolean isFileCatalystServerPro
      • isFileCatalystServer

        protected boolean isFileCatalystServer
      • remoteServiceVersion

        protected unlimited.core.util.common.version.RemoteServiceVersion remoteServiceVersion
      • isConnected

        protected boolean isConnected
      • maxServerRate

        protected int maxServerRate
      • monitoredTransfer

        protected unlimited.core.transfers.io.MonitoredTransfer monitoredTransfer
      • targetRate

        protected int targetRate
      • cachePWD

        protected java.lang.String cachePWD
      • sizeCache

        protected com.google.common.cache.Cache<java.lang.String,​java.lang.String> sizeCache
      • modtimeCache

        protected com.google.common.cache.Cache<java.lang.String,​java.lang.String> modtimeCache
      • newDownloadRate

        protected int newDownloadRate
      • clientName

        protected java.lang.String clientName
      • clientWorkingPath

        protected java.nio.file.Path clientWorkingPath
      • sessionID

        protected java.lang.String sessionID
      • serverAgentID

        protected java.lang.String serverAgentID
      • clientAgentID

        protected java.lang.String clientAgentID
      • sessionTimeStamp

        public final long sessionTimeStamp
      • sessionCount

        public final int sessionCount
      • transferID

        protected int transferID
      • servletLocation

        protected java.lang.String servletLocation
      • http

        protected boolean http
      • shouldPerformServerPostProcess

        protected boolean shouldPerformServerPostProcess
      • transferSettings

        protected unlimited.core.transfers.io.udptransfers.UDPTransferSettings transferSettings
      • isLoggedIn

        protected boolean isLoggedIn
      • isTransferringData

        protected boolean isTransferringData
      • sessionPriority

        protected volatile int sessionPriority
      • sslSocketProducer

        protected unlimited.core.util.common.net.ssl.FCSSLSocketProducerImpl sslSocketProducer
    • Constructor Detail

      • FCClientEngine

        protected FCClientEngine()
        Default constructor -- used by FCClientEngineHTTP
    • Method Detail

      • remoteServiceVersion

        public unlimited.core.util.common.version.RemoteServiceVersion remoteServiceVersion()
        Specified by:
        remoteServiceVersion in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getTaskID

        public java.lang.String getTaskID()
      • setTaskID

        public void setTaskID​(java.lang.String taskID)
      • setMonitoredTransfer

        public void setMonitoredTransfer​(unlimited.core.transfers.io.MonitoredTransfer monitoredTransfer)
        Specified by:
        setMonitoredTransfer in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getLastThroughtput

        public long getLastThroughtput()
      • getComLock

        public java.lang.Object getComLock()
      • getMonitoredTransfer

        public final unlimited.core.transfers.io.MonitoredTransfer getMonitoredTransfer()
        Specified by:
        getMonitoredTransfer in interface unlimited.core.transfers.io.FCClientEngineBridge
      • setUDPTransferMetrics

        public void setUDPTransferMetrics​(unlimited.core.transfers.UDPTransferMetrics udp)
        Specified by:
        setUDPTransferMetrics in interface unlimited.core.transfers.io.FCClientEngineBridge
      • generateNewTransferID

        public void generateNewTransferID()
        Specified by:
        generateNewTransferID in interface unlimited.core.transfers.io.FCClientEngineBridge
      • setTransferID

        protected final void setTransferID​(int transferID)
      • getCurrentFileToIDs

        public java.util.Map<java.lang.String,​java.lang.Integer> getCurrentFileToIDs()
      • setCurrentFileToIDs

        public void setCurrentFileToIDs​(java.util.Map<java.lang.String,​java.lang.Integer> currentFileToIDs)
      • isQuitting

        public boolean isQuitting()
      • setQuitting

        public void setQuitting​(boolean quitting)
      • createFCClientEngine

        public static FCClientEngine createFCClientEngine​(java.lang.String remoteHost,
                                                          boolean sslSocket)
                                                   throws java.io.IOException,
                                                          unlimited.core.util.common.exception.FCException
        Used by test class
        Parameters:
        remoteHost -
        sslSocket -
        Returns:
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • createFCClientEngine

        public static FCClientEngine createFCClientEngine​(java.lang.String remoteHost,
                                                          boolean sslSocket,
                                                          FCClient fcClient)
                                                   throws java.io.IOException,
                                                          unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • createFCClientEngine

        public static FCClientEngine createFCClientEngine​(FCClientControlSocketRequestData ctrlSocketData)
                                                   throws java.io.IOException,
                                                          unlimited.core.util.common.exception.FCException
        Main constructor call, used by most FileCatalyst products.
        Parameters:
        remoteHost -
        ctrlClientPort -
        sslSocket -
        log -
        millis -
        enableReporting -
        Returns:
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • createFCClientEngine

        public static FCClientEngine createFCClientEngine​(FCClientControlSocketRequestData ctrlSocketData,
                                                          FCClient fcClient)
                                                   throws java.io.IOException,
                                                          unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • createFCClientEngine

        public static unlimited.core.transfers.io.FCClientEngineBridge createFCClientEngine​(java.net.Socket controlSocket,
                                                                                            boolean sslSocket,
                                                                                            java.util.function.Supplier<ClientCredentials> credentials,
                                                                                            unlimited.core.util.common.logs.LogUtils log,
                                                                                            int millis)
                                                                                     throws java.io.IOException,
                                                                                            unlimited.core.util.common.exception.FCException
        Used by FCClient.java
        Parameters:
        controlSocket -
        sslSocket -
        user -
        password -
        log -
        millis -
        enableReporting -
        fileMode - File mode UDP Receiver should open up files. Valid modes should be "", rw, rws, rwd. Blank lets the OS detemine the mode (legacy)
        writeBufferSize - Size of write buffer (in bytes) to use to write to disk. Default size of zero will save files in block-size chunks.
        Returns:
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • createFCClientEngine

        public static FCClientEngine createFCClientEngine​(java.net.Socket controlSocket,
                                                          boolean sslSocket,
                                                          java.util.function.Supplier<ClientCredentials> credentials,
                                                          unlimited.core.util.common.logs.LogUtils log,
                                                          int millis,
                                                          FCClient fcClient)
                                                   throws java.io.IOException,
                                                          unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • initSOCKS

        public static void initSOCKS​(java.lang.String port,
                                     java.lang.String host)
        Set up SOCKS v4/v5 proxy settings. This can be used if there is a SOCKS proxy server in place that must be connected thru. Note that setting these properties directs all TCP sockets in this JVM to the SOCKS proxy
        Parameters:
        port - SOCKS proxy port
        host - SOCKS proxy hostname
      • initSOCKSAuthentication

        public static void initSOCKSAuthentication​(java.lang.String username,
                                                   java.lang.String password)
        Set up SOCKS username and password for SOCKS username/password authentication. Often, no authentication will be required but the SOCKS server may be configured to request these.
        Parameters:
        username - the SOCKS username
        password - the SOCKS password
      • setReadTimeout

        public void setReadTimeout​(int millisecs)
        This is the timeout value that get set when we are sending commands that should not take long to execute, PWD, LIST, etc...
        Parameters:
        millisecs - int
      • setConnectMode

        @Deprecated
        public void setConnectMode​(FCConnectMode mode)
        Deprecated.
        Set the connect mode
        Parameters:
        mode - ACTIVE or PASV mode
      • isConnected

        public boolean isConnected()
        Get the connection status
        Returns:
        true if a connection was established, otherwise false
      • setErrorMessage

        public void setErrorMessage​(java.lang.String errMess)
        Sets the last error message text
        Parameters:
        errMess - text of the error message
      • setDataPort

        public void setDataPort​(int[] dataPort)
        Set the DataPort
        Parameters:
        dataPort -
      • getDataPort

        public int[] getDataPort()
      • getErrorMessage

        public java.lang.String getErrorMessage()
        Get the last error message text
        Returns:
        text of the errpr message
      • setLogStream

        public void setLogStream​(unlimited.core.util.common.logs.LogUtils log)
        Set the logging stream, replacing stdout
        Parameters:
        log - the new logging stream
      • setMaxServerRate

        public void setMaxServerRate​(int rate)
        set the max server rate (aka bandwidth)
        Parameters:
        rate -
      • setMaxRate

        public void setMaxRate​(int rate)
      • getLastValidReply

        public unlimited.core.transfers.io.FCReply getLastValidReply()
        Gets the latest valid reply from the server
        Specified by:
        getLastValidReply in interface unlimited.core.transfers.io.FCClientEngineBridge
        Returns:
        reply object encapsulating last valid server response
      • getLastReplyText

        public java.lang.String getLastReplyText()
        Gets the latest valid reply from the server
        Specified by:
        getLastReplyText in interface unlimited.core.transfers.io.FCClientEngineBridge
        Returns:
        the text of last valid server response
      • setup

        public void setup​(java.util.function.Supplier<ClientCredentials> newCredentials)
                   throws java.io.IOException,
                          unlimited.core.util.common.exception.FCException
        Login into an account on the FileCatalyst server. This call completes the entire login process Note that we only use the User/Pass if we haven't set the tokens on this client. If we have tokens we call that method.
        Parameters:
        ClientCredentials - credentials
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • setLastValidReply

        protected void setLastValidReply​(unlimited.core.transfers.io.FCReply reply)
      • testUDPACKs

        public void testUDPACKs()
      • detectFCServer

        public void detectFCServer()
                            throws java.io.IOException,
                                   unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • notifyServerOfCurrentRTT

        public void notifyServerOfCurrentRTT()
                                      throws java.io.IOException,
                                             unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • quit

        public void quit()
                  throws java.io.IOException,
                         unlimited.core.util.common.exception.FCException
        Quit the FileCatalyst session
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • quit

        public void quit​(boolean flushCaches)
                  throws java.io.IOException,
                         unlimited.core.util.common.exception.FCException
        Quit the FileCatalyst session, optionally do not flush the cache, in the case of a reconnect attempt
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • getVersionForSetup

        protected java.lang.String getVersionForSetup()
      • abort

        public void abort​(boolean waitForReply)
                   throws java.io.IOException,
                          unlimited.core.util.common.exception.FCException
        Abort a FileCatalyst transmision and reception
        Specified by:
        abort in interface unlimited.core.transfers.io.FCClientEngineBridge
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • checkDownloadPermissions

        public boolean checkDownloadPermissions()
        Returns true if this user acount has download permissions
        Returns:
      • checkUploadModifyPermissions

        public boolean checkUploadModifyPermissions()
        Returns true if this user acount has upload/modify/rename permissions Use A Random String Because Fast Machines With Multi-Client Can Have Overlapping Timeslices
      • quote

        public void quote​(java.lang.String command,
                          java.lang.String[] validCodes)
                   throws java.io.IOException,
                          unlimited.core.util.common.exception.FCException
        Issue arbitrary FileCatalyst commands to the FileCatalyst server.
        Specified by:
        quote in interface unlimited.core.transfers.io.FCClientEngineBridge
        Parameters:
        command - command to be sent to server
        validCodes - valid return codes for this command
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • help

        public java.lang.String help​(java.lang.String command)
                              throws java.io.IOException,
                                     unlimited.core.util.common.exception.FCException
        Get the help text for the specified command
        Parameters:
        command - name of the command to get help on
        Returns:
        help text from the server for the supplied command
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • system

        public java.lang.String system()
                                throws java.io.IOException,
                                       unlimited.core.util.common.exception.FCException
        Get the type of the OS at the server
        Returns:
        the type of server OS
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • getSystKey

        protected java.lang.String getSystKey()
      • innerSyst

        protected java.lang.String innerSyst()
                                      throws java.io.IOException,
                                             unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • featureSet

        public java.lang.String featureSet()
                                    throws java.io.IOException,
                                           unlimited.core.util.common.exception.FCException
        Get the feature list from the server
        Returns:
        String Returns the feature list of the server
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • serverSupportsFSEvents

        public boolean serverSupportsFSEvents()
        Checks if FSEVT command is supported. Only as of 2.8.1
        Returns:
      • fileSystemEvents

        public java.util.ArrayList<FileSystemEvent> fileSystemEvents​(long timeout)
                                                              throws java.io.IOException,
                                                                     unlimited.core.util.common.exception.FCException
        Get a list of file system events from the server
        Returns:
        String a list of file system events from the server
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • filter

        public void filter​(FileCatalystFileFilter<?> filter)
                    throws java.io.IOException
        Initializes the file filter on the server. This filter is applied to the next listing that is requested from the server. It is immediately reset by the server after each listing. Therefore it should be reset each time a listing is done if needed.
        Parameters:
        filter - Filter object containing the data that you wish to filter on
        Throws:
        java.io.IOException
      • buildFilterCommand

        protected java.lang.String buildFilterCommand​(FileCatalystFileFilter<?> filter)
                                               throws unlimited.core.util.common.exception.FCException
        Builds the command that will bew used to send the filte data to the Server
        Parameters:
        filter - Filter that contains the data that we will be sending
        Returns:
        String containing the full command
        Throws:
        unlimited.core.util.common.exception.FCException
      • filter

        @Deprecated
        public void filter​(long olderThan,
                           long newerThan,
                           long upperByteLimit,
                           long lowerByteLimit,
                           java.lang.String filterString,
                           int filterMode,
                           boolean applyFilterToDirectories)
                    throws java.io.IOException,
                           unlimited.core.util.common.exception.FCException
        Deprecated.
        This method is deprecated. Please use filter(FileCatalystFileFilter) instead
        Initializes the file filter on the server. This filter is applied to the next listing that is requested from the server. It is immediately reset by the server after each listing. Therefore it should be reset each time a listing is done if needed.
        Parameters:
        olderThan -
        newerThan -
        upperByteLimit -
        lowerByteLimit -
        filterString -
        filterMode -
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • modtime

        public void modtime​(java.lang.String remoteFile,
                            java.util.Date d)
                     throws java.io.IOException,
                            unlimited.core.util.common.exception.FCException
        Set modification time for a remote file
        Parameters:
        remoteFile - name of remote file
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • modtime

        public java.util.Date modtime​(java.lang.String remoteFile)
                               throws java.io.IOException,
                                      unlimited.core.util.common.exception.FCException
        Get modification time for a remote file
        Parameters:
        remoteFile - name of remote file
        Returns:
        modification time of file as a date
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • modtime

        public java.util.Date modtime​(java.lang.String remoteFile,
                                      boolean bypassCache)
                               throws java.io.IOException,
                                      unlimited.core.util.common.exception.FCException
        Get modification time for a remote file
        Parameters:
        remoteFile - name of remote file
        Returns:
        modification time of file as a date
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • flushCaches

        public void flushCaches()
        Flush the caches used in the transfer
      • noop

        public void noop()
                  throws java.io.IOException,
                         unlimited.core.util.common.exception.FCException
        Send a NOOP command
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • log

        public void log​(java.lang.String line)
        Specified by:
        log in interface unlimited.core.transfers.io.FCClientEngineBridge
      • log

        public void log​(java.lang.String line,
                        java.lang.Throwable e)
        Specified by:
        log in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getLogger

        public unlimited.core.util.common.logs.LogUtils getLogger()
        Specified by:
        getLogger in interface unlimited.core.transfers.io.FCClientEngineBridge
      • testIncomingUDP

        public int testIncomingUDP​(int packetSize,
                                   int expectedPackets,
                                   int rate,
                                   int destinationPort)
                            throws java.io.IOException,
                                   unlimited.core.util.common.exception.FCException
        Send a RUDP command Server will send the specifed number of packets back to the client returns number of packets recieved by client
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • testOutgoingUDP

        public int testOutgoingUDP​(int packetSize,
                                   int numpackets,
                                   int rate)
                            throws java.io.IOException,
                                   unlimited.core.util.common.exception.FCException
        Send a TUDP command returns number of packets received by the server
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • testDataConnection

        public void testDataConnection()
                                throws java.io.IOException,
                                       unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • testDataConnection

        public void testDataConnection​(boolean portFallback)
                                throws java.io.IOException,
                                       unlimited.core.util.common.exception.FCException
        Tests whether TCP data connection is possible. Also allows you to specify whether to fall back to PORT if PASV fails.
        Parameters:
        portFallback -
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • testMultiDataConnection

        public void testMultiDataConnection()
                                     throws java.io.IOException,
                                            unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • isServerTimeout

        public boolean isServerTimeout()
                                throws unlimited.core.util.common.exception.FCException,
                                       java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • initAES

        public void initAES()
                     throws java.io.IOException,
                            unlimited.core.util.common.exception.FCException
        Send a AESK command, initialized the AES secret key on the server
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • pwd

        public java.lang.String pwd()
                             throws java.io.IOException,
                                    unlimited.core.util.common.exception.FCException
        Get the current remote working directory
        Returns:
        the current working directory
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • cdup

        public void cdup()
                  throws java.io.IOException,
                         unlimited.core.util.common.exception.FCException
        Change to the parent directory
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • exists

        public boolean exists​(java.lang.String remoteFile)
                       throws unlimited.core.util.common.exception.FCException,
                              java.io.IOException
        Test if the remote file, denoted by the given remote path, exists on the server and returns true if it exists, false otherwise.
        Parameters:
        remoteFile - String The path to the remote file
        Returns:
        boolean True if the file exists, false otherwise
        Throws:
        unlimited.core.util.common.exception.FCException - If an error in the FC protocol occurs
        java.io.IOException - If a timeout, or other IO error occurs
      • serverSupportsUDP

        public boolean serverSupportsUDP()
      • isFileCatalystServer

        public boolean isFileCatalystServer()
        True if it is a FileCatalyst Server. False if it is a 3PP server
        Specified by:
        isFileCatalystServer in interface unlimited.core.transfers.io.FCClientEngineBridge
        Returns:
      • isFileCatalystServerPro

        public boolean isFileCatalystServerPro()
        True if is a PRO (non-UDP) FileCatalyst License.
        Specified by:
        isFileCatalystServerPro in interface unlimited.core.transfers.io.FCClientEngineBridge
        Returns:
      • isFileCatalystServerEnterprise

        public boolean isFileCatalystServerEnterprise()
        Specified by:
        isFileCatalystServerEnterprise in interface unlimited.core.transfers.io.FCClientEngineBridge
      • binary

        public void binary()
                    throws java.io.IOException,
                           unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • setDownloadRate

        public void setDownloadRate​(int targetRate,
                                    int startRate)
                             throws java.io.IOException,
                                    unlimited.core.util.common.exception.FCException
        Sets the target rate of the current transfer
        Specified by:
        setDownloadRate in interface unlimited.core.transfers.io.FCClientEngineBridge
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • sendTransmitRateCommand

        protected void sendTransmitRateCommand​(int targetRate,
                                               int startRate)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getFCClientObject

        public FCClient getFCClientObject()
                                   throws unlimited.core.util.common.exception.FCException,
                                          java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • reconnect

        public void reconnect​(boolean maintainCurrentDirectory)
                       throws unlimited.core.util.common.exception.FCException,
                              java.io.IOException
        Specified by:
        reconnect in interface unlimited.core.transfers.io.FCClientEngineBridge
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • chdir

        public void chdir​(java.lang.String dir)
                   throws java.io.IOException,
                          unlimited.core.util.common.exception.FCException
        Change the remote working directory to that supplied
        Parameters:
        dir - name of remote directory to change to
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • refreshCachedPWD

        protected void refreshCachedPWD​(java.lang.String dir)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • mkfile

        public void mkfile​(java.lang.String file)
                    throws java.io.IOException,
                           unlimited.core.util.common.exception.FCException
        Create the specified remote working directory
        Parameters:
        dir - name of remote directory to create
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • mkdir

        public void mkdir​(java.lang.String remotedir)
                   throws java.io.IOException,
                          unlimited.core.util.common.exception.FCException
        Create the specified remote working directory
        Parameters:
        dir - name of remote directory to create
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • mksig

        public java.lang.String mksig​(java.lang.String srcfile,
                                      java.lang.String uniqueID)
                               throws java.io.IOException,
                                      unlimited.core.util.common.exception.FCException
        Parameters:
        srcfile -
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • mksig

        public java.lang.String mksig​(java.lang.String srcfile,
                                      boolean compress,
                                      java.lang.String uniqueID)
                               throws java.io.IOException,
                                      unlimited.core.util.common.exception.FCException
        Parameters:
        srcfile - String Name of the source file.
        compress - boolean Compress flag for the signature. Default false (value currently ignored in v2.4.2)
        uniqueID - String Unique identifier for the delta transfer
        Returns:
        String reply from target. if target < v2.4.2 will return: block size if target >= v2.4.2 will return: block size + " " + "unique file name"
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • mkdlt

        public void mkdlt​(java.lang.String srcfile,
                          java.lang.String sigfile,
                          int blockLength,
                          boolean compress,
                          int compLevel,
                          int strategy)
                   throws java.io.IOException,
                          unlimited.core.util.common.exception.FCException
        Called by ReceiverHandler to create a delta file remotely. Legacy call -- pre v2.4.2. Does not include a UNIQUEID, so multiple concurrent delta calculations on the same file may corrupt it.
        Parameters:
        srcfile - String
        sigfile - String
        blockLength - int
        compress - boolean
        compLevel - int
        strategy - int
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • mkdlt

        public void mkdlt​(java.lang.String srcfile,
                          java.lang.String sigfile,
                          int blockLength,
                          boolean compress,
                          int compLevel,
                          int strategy,
                          java.lang.String uniqueID,
                          boolean waitForDeltaCreation)
                   throws java.io.IOException,
                          unlimited.core.util.common.exception.FCException
        Called by ReceiverHandler to create a delta file remotely. Uses UNIQUEID, to allow concurrent deltas to be created on the same file. v2.4.2+.
        Parameters:
        srcfile - String
        sigfile - String
        blockLength - int
        compress - boolean
        compLevel - int
        strategy - int
        uniqueID - String
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • isDeltasStillGrowing

        public boolean isDeltasStillGrowing()
                                     throws unlimited.core.util.common.exception.FCException,
                                            java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • isZipStillGrowing

        public boolean isZipStillGrowing​(java.lang.String zipFileName)
                                  throws unlimited.core.util.common.exception.FCException,
                                         java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • innerZipChunkTest

        protected boolean innerZipChunkTest​(java.lang.String zipFileName)
                                     throws unlimited.core.util.common.exception.FCException,
                                            java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • isZipStillExtracting

        public boolean isZipStillExtracting()
                                     throws unlimited.core.util.common.exception.FCException,
                                            java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • rbfil

        public java.lang.String rbfil​(java.lang.String srcfile,
                                      java.lang.String deltafile,
                                      int blockLength,
                                      boolean compress,
                                      int level,
                                      boolean uniqueName)
                               throws java.io.IOException,
                                      unlimited.core.util.common.exception.FCException
        Parameters:
        srcfile - String
        deltafile - String
        blockLength - int
        compress - boolean
        level - int
        uniqueName - boolean
        Returns:
        String The remote filename, may be the original destination, or a unique name.
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • rmdir

        public void rmdir​(java.lang.String dir)
                   throws java.io.IOException,
                          unlimited.core.util.common.exception.FCException
        Delete the specified remote working directory
        Parameters:
        dir - name of remote directory to delete
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • serverPostProcess

        public void serverPostProcess​(java.lang.String file)
                               throws java.io.IOException,
                                      unlimited.core.util.common.exception.FCException
        Execute post processing on the specified file
        Parameters:
        file - The file on which to perform post processing
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • shouldPerformServerPostProcess

        public boolean shouldPerformServerPostProcess()
      • rename

        public void rename​(java.lang.String from,
                           java.lang.String to)
                    throws java.io.IOException,
                           unlimited.core.util.common.exception.FCException
        Rename a file or directory
        Parameters:
        from - name of file or directory to rename
        to - intended name
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • delete

        public void delete​(java.lang.String remoteFile)
                    throws java.io.IOException,
                           unlimited.core.util.common.exception.FCException
        Delete the specified remote file
        Parameters:
        remoteFile - name of remote file to delete
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • deleteAll

        public void deleteAll​(java.util.List<java.lang.String> remoteFiles)
                       throws java.io.IOException,
                              unlimited.core.util.common.exception.FCException
        Bulk delete, deletes all the specified files in a single command. The server returns intermediate replies to keep the connection alive during a long delete
        Parameters:
        remoteFiles - files to delete
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • deleteAll

        public void deleteAll​(java.util.List<java.lang.String> remoteFiles,
                              boolean ftpDelete)
                       throws java.io.IOException,
                              unlimited.core.util.common.exception.FCException
        Bulk delete, deletes all the specified files in a single command. The server returns intermediate replies to keep the connection alive during a long delete
        Parameters:
        remoteFiles - files to delete
        ftpDelete - use FTP style deletion, rejecting deletes on directories if they contain items
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • deleteAll

        public void deleteAll​(FileListData remoteFiles)
                       throws unlimited.core.util.common.exception.FCException,
                              java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • deleteAll

        public void deleteAll​(FileListData remoteFiles,
                              boolean ftpDelete)
                       throws unlimited.core.util.common.exception.FCException,
                              java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • applyRemoteFileAttributesToLocalFile

        public void applyRemoteFileAttributesToLocalFile​(java.nio.file.Path localFile,
                                                         java.lang.String remoteFile)
                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • getMD5

        public java.lang.String getMD5​(java.lang.String remoteFile)
                                throws java.io.IOException,
                                       unlimited.core.util.common.exception.FCException
        Request the MD5 digest of the remote file
        Parameters:
        remoteFile - name of remote file to delete
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • unzip

        public void unzip​(java.lang.String remoteFile,
                          boolean maintainPermissions,
                          boolean maintainTimeStamp)
                   throws java.io.IOException,
                          unlimited.core.util.common.exception.FCException
        Request that a file on the server be unzipped
        Parameters:
        remoteFile - name of remote file to unzip
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • buildUNZIPCommand

        protected java.lang.String buildUNZIPCommand​(java.lang.String remoteFile,
                                                     boolean maintainPermissions,
                                                     boolean maintainTimeStamp)
      • zip

        public void zip​(java.lang.String zipFilename,
                        java.util.List<java.lang.String> remoteFiles)
                 throws java.io.IOException,
                        unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • zip

        public void zip​(java.lang.String zipFilename,
                        java.util.List<java.lang.String> remoteFiles,
                        long zipSizeLimit)
                 throws java.io.IOException,
                        unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • zip

        public void zip​(java.lang.String zipFilename,
                        java.util.List<java.lang.String> remoteFiles,
                        long zipSizeLimit,
                        boolean waitForZipCreation,
                        boolean needsRecurse)
                 throws java.io.IOException,
                        unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • getMD5

        public java.lang.String getMD5​(java.lang.String remoteFile,
                                       long offset,
                                       long length)
                                throws java.io.IOException,
                                       unlimited.core.util.common.exception.FCException
        Request the MD5 digest of the remote file
        Parameters:
        remoteFile - name of remote file to delete
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • getMD5

        public java.lang.String getMD5​(java.lang.String remoteFile,
                                       long offset,
                                       long length,
                                       long checkInterval,
                                       long checkLength)
                                throws java.io.IOException,
                                       unlimited.core.util.common.exception.FCException
        Request the Partial MD5 digest of the remote file
        Parameters:
        remoteFile - name of remote file to delete
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • performSyncedMD5

        protected java.lang.String performSyncedMD5​(java.lang.String md5Command)
                                             throws java.io.IOException,
                                                    unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • performAsyncMD5

        protected java.lang.String performAsyncMD5​(java.lang.String md5Command)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • dir

        public FileListData dir​(java.lang.String dirname,
                                boolean full)
                         throws java.io.IOException,
                                unlimited.core.util.common.exception.FCException
        List a directory's contents as an array of strings. A detailed listing is available, otherwise just filenames are provided. Note that a full listing can be used on a file name to obtain information about a file.
        Parameters:
        dirname - name of directory ( not a file mask)
        full - true if detailed listing required false otherwise
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • dirRaw

        public java.lang.String[] dirRaw​(java.lang.String dirname,
                                         boolean full,
                                         java.lang.String filterFlag)
                                  throws java.io.IOException,
                                         unlimited.core.util.common.exception.FCException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • getDirListTool

        protected DirListTool getDirListTool​(DirListParams p,
                                             FCClientEngine e)
                                      throws unlimited.core.util.common.exception.FCException,
                                             java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • dir

        public FileListData dir​(java.lang.String dirname,
                                boolean full,
                                java.lang.String filterFlag)
                         throws java.io.IOException,
                                unlimited.core.util.common.exception.FCException
        List a directory's contents as an array of strings. A detailed listing is available, otherwise just filenames are provided. Note that a full listing can be used on a file name to obtain information about a file.
        Parameters:
        dirname - name of directory ( not a file mask)
        full - true if detailed listing required false otherwise
        filterFlag - apply a filter flag (-f for files) to the dir command. Only valid when FULL is set to FALSE.
        Returns:
        an array of directory listing strings
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • dir

        public FileListData dir​(java.lang.String dirname,
                                boolean full,
                                java.lang.String filterFlag,
                                java.lang.String wildcard)
                         throws java.io.IOException,
                                unlimited.core.util.common.exception.FCException
        List a directory's contents as an array of strings. A detailed listing is available, otherwise just filenames are provided. Note that a full listing can be used on a file name to obtain information about a file.
        Parameters:
        dirname - name of directory ( not a file mask)
        full - true if detailed listing required false otherwise
        filterFlag - apply a filter flag (-f for files) to the dir command. Only valid when FULL is set to FALSE.
        wildcard - apply a wildcard to the list on server side to increase performance
        Returns:
        an array of directory listing strings
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • doDirListing

        protected FileListData doDirListing​(java.lang.String dirname,
                                            boolean full,
                                            java.lang.String filterFlag,
                                            java.lang.String wildcard,
                                            FileListDataItemConsumer resultData)
                                     throws java.io.IOException,
                                            unlimited.core.util.common.exception.FCException,
                                            java.net.SocketException,
                                            java.io.UnsupportedEncodingException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
        java.net.SocketException
        java.io.UnsupportedEncodingException
      • doDirListing

        protected FileListData doDirListing​(java.lang.String dirname,
                                            boolean full,
                                            java.lang.String filterFlag,
                                            java.lang.String wildcard,
                                            FileListDataItemConsumer resultData,
                                            java.util.function.BooleanSupplier isCancelled)
                                     throws java.io.IOException,
                                            unlimited.core.util.common.exception.FCException,
                                            java.net.SocketException,
                                            java.io.UnsupportedEncodingException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
        java.net.SocketException
        java.io.UnsupportedEncodingException
      • doDirStream

        public java.util.stream.Stream<FileListDataItem> doDirStream​(java.lang.String dirname,
                                                                     boolean full,
                                                                     java.lang.String filterFlag,
                                                                     java.lang.String wildcard,
                                                                     FileListDataItemConsumer resultData,
                                                                     java.util.function.BooleanSupplier isCancelled)
                                                              throws java.io.IOException,
                                                                     unlimited.core.util.common.exception.FCException,
                                                                     java.net.SocketException,
                                                                     java.io.UnsupportedEncodingException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
        java.net.SocketException
        java.io.UnsupportedEncodingException
      • doDirStream

        public java.util.stream.Stream<FileListDataItem> doDirStream​(DirListParams params)
                                                              throws unlimited.core.util.common.exception.FCException,
                                                                     java.io.IOException,
                                                                     java.net.SocketException,
                                                                     java.io.UnsupportedEncodingException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
        java.net.SocketException
        java.io.UnsupportedEncodingException
      • rmdirRecursive

        public void rmdirRecursive​(FileListDataItem item)
                            throws java.lang.Exception
        Recursively delete a remote folder
        Parameters:
        item -
        Throws:
        java.lang.Exception
      • dir

        public FileListData dir​(java.lang.String dirname)
                         throws java.io.IOException,
                                unlimited.core.util.common.exception.FCException
        List a directory's contents as an array of strings of filenames.
        Parameters:
        dirname - name of directory( not a file mask)
        Returns:
        an array of directory listing strings
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • dir

        public FileListData dir()
                         throws java.io.IOException,
                                unlimited.core.util.common.exception.FCException
        List current directory's contents as an array of strings of filenames.
        Returns:
        an array of current directory listing strings
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • sendEmail

        public void sendEmail​(java.lang.String emailAddress,
                              int statusCode,
                              java.lang.String note)
                       throws java.io.IOException,
                              unlimited.core.util.common.exception.FCException
        Instruct the server to send an email to the administrator
        Parameters:
        email - the senders email address
        code - the constant code representing the transfer status
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • site

        public boolean site​(java.lang.String command)
                     throws java.io.IOException,
                            unlimited.core.util.common.exception.FCException
        Run a site-specific command on the server. Support for commands is dependent on the server
        Parameters:
        command - the site command to run
        Returns:
        true if command ok, false if command not implemented
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • size

        public java.lang.String size​(java.lang.String fileName,
                                     boolean bypassCache)
                              throws java.io.IOException,
                                     unlimited.core.util.common.exception.FCException
        Get the size of the named file from the remote server.
        Specified by:
        size in interface unlimited.core.transfers.io.FCClientEngineBridge
        Parameters:
        fileName - name of the file
        Returns:
        the size of the file
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • creationTime

        public long creationTime​(java.lang.String fileName)
                          throws java.io.IOException,
                                 unlimited.core.util.common.exception.FCException
        Get the creation time of the named file from the remote server.
        Parameters:
        fileName - name of the file
        Returns:
        the creation time of the file (in millis)
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • accessTime

        public long accessTime​(java.lang.String fileName)
                        throws java.io.IOException,
                               unlimited.core.util.common.exception.FCException
        Get the last access time of the named file from the remote server.
        Parameters:
        fileName - name of the file
        Returns:
        the access time of the file (in millis)
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • getPlatForm

        public java.lang.String getPlatForm()
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getIdealConcurrentFTPStreams

        public int getIdealConcurrentFTPStreams​(int rate,
                                                long length,
                                                int bufferSize,
                                                int maxStream)
        Specified by:
        getIdealConcurrentFTPStreams in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getServerVersion

        public java.lang.String getServerVersion()
      • prms

        public java.lang.String[] prms​(java.lang.String fileName)
                                throws java.io.IOException,
                                       unlimited.core.util.common.exception.FCException
        Return the file permission of the file/directory listed in the argument from the remote server.
        Parameters:
        fileName - name of the file
        Returns:
        permissions
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • resetTransferVariables

        public void resetTransferVariables()
      • put

        public void put​(UploadTransferRequestData requestData)
                 throws java.io.IOException,
                        unlimited.core.util.common.exception.FCException
        Put a local file onto the FileCatalyst server. It is placed in the current directory. Allows appending if current file exists
        Parameters:
        localPath - path of the local file
        remoteFile - name of remote file in current directory
        outRate - sending bandwidth
        numDFEncoders - number of DF encoders to be used
        append - true if appending, false otherwise
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • putIsFinished

        public boolean putIsFinished()
      • getHTTP

        public void getHTTP​(DownloadTransferRequestData requestData)
                     throws java.io.IOException,
                            unlimited.core.util.common.exception.FCException,
                            java.io.IOException
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • setOverrideServerBandwidth

        public void setOverrideServerBandwidth​(unlimited.core.transfers.io.ftptransfers.FTPTransmit transfer)
        Specified by:
        setOverrideServerBandwidth in interface unlimited.core.transfers.io.FCClientEngineBridge
      • isTimeout

        public final boolean isTimeout​(java.lang.String message)
        Specified by:
        isTimeout in interface unlimited.core.transfers.io.FCClientEngineBridge
      • isChannelClosed

        protected final boolean isChannelClosed​(java.lang.String message)
      • getRemoteHost

        protected java.lang.String getRemoteHost()
        Returns:
      • getLocalHost

        protected java.lang.String getLocalHost()
        Returns:
      • detectSessionKilledByAdmin

        protected void detectSessionKilledByAdmin()
      • sendRTTKeepALive

        protected void sendRTTKeepALive()
      • gobbleExtraReplies

        public void gobbleExtraReplies​(int incomingTimeout,
                                       int incomingNumToGobble)
        Specified by:
        gobbleExtraReplies in interface unlimited.core.transfers.io.FCClientEngineBridge
      • get

        public void get​(DownloadTransferRequestData downloadRequestData)
                 throws java.io.IOException,
                        unlimited.core.util.common.exception.FCException,
                        java.security.NoSuchAlgorithmException,
                        unlimited.core.util.common.exception.FCException,
                        java.io.IOException
        Get a file from the FileCatalyst server. It is placed in the current directory. Allows resuming if current file exists
        Parameters:
        localPath - path of the local file
        remoteFile - name of remote file in current directory
        outRate - sending bandwidth
        numDFEncoders - number of DF encoders to be used
        append - true if appending, false otherwise
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
        java.security.NoSuchAlgorithmException
      • createThirdPartyFTPServerDataConnection

        public java.net.Socket createThirdPartyFTPServerDataConnection​(java.lang.String command)
                                                                throws java.io.IOException
        Specified by:
        createThirdPartyFTPServerDataConnection in interface unlimited.core.transfers.io.FCClientEngineBridge
        Throws:
        java.io.IOException
      • isReportingEnabled

        public boolean isReportingEnabled()
      • initFCTransfer

        public int[] initFCTransfer​(int numDecoders,
                                    int blockSize,
                                    int unitSize,
                                    long length,
                                    boolean congestionControl,
                                    int fileID,
                                    int mode)
                             throws unlimited.core.util.common.exception.FCException,
                                    java.io.IOException
        Specified by:
        initFCTransfer in interface unlimited.core.transfers.io.FCClientEngineBridge
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • update

        public void update​(java.util.Observable observable,
                           java.lang.Object object)
        Specified by:
        update in interface java.util.Observer
        Parameters:
        observable -
        object -
      • informServerToWriteReport

        protected void informServerToWriteReport​(PropertyTransmission reportArgs)
      • getReportStatus

        public java.lang.String getReportStatus​(unlimited.core.transfers.io.MonitoredTransfer monTransfer)
      • getReportStatus

        public java.lang.String getReportStatus​(MultiTransferHandler<?> monTransfer)
      • getTransferPercent

        public int getTransferPercent()
        Specified by:
        getTransferPercent in interface unlimited.core.transfers.TransferHandler
        Returns:
        the current transfer completion percentage
      • getMeanEffectiveRate

        public int getMeanEffectiveRate()
        Specified by:
        getMeanEffectiveRate in interface unlimited.core.transfers.TransferHandler
        Returns:
        the current transfer rate in Kbps
      • getBlastRate

        public int getBlastRate()
        2015/11/25 - leaving the comment below on what this returns, but noting that what it really returns is the mean average of total good data sent. So the method was renamed (via refactoring) and the original was put back to call renamed version ...
        Returns:
        the current blast rate in Kbps
      • getTransferRate

        public int getTransferRate()
      • getCurrentRate

        public int getCurrentRate()
      • getCurrentGoodputRate

        public int getCurrentGoodputRate()
      • getTransferGoodput

        public long getTransferGoodput()
        Specified by:
        getTransferGoodput in interface unlimited.core.transfers.TransferHandler
        Returns:
        the number of useful bytes sent during current transfer
      • getTransferThroughput

        public long getTransferThroughput()
        Specified by:
        getTransferThroughput in interface unlimited.core.transfers.TransferHandler
        Returns:
        the number of bytes sent during current transfer
      • isTransferComplete

        public boolean isTransferComplete()
        Specified by:
        isTransferComplete in interface unlimited.core.transfers.TransferHandler
        Returns:
        true if the current transfer is complete
      • isTransferCancelled

        public boolean isTransferCancelled()
        Specified by:
        isTransferCancelled in interface unlimited.core.transfers.TransferHandler
        Returns:
        true if a transfer was cancelled
      • isTransferError

        public boolean isTransferError()
        Specified by:
        isTransferError in interface unlimited.core.transfers.TransferHandler
        Returns:
        true if an error occured dureing the transfer
      • cancelTransfer

        public boolean cancelTransfer()
        Cancels the current transfer, if one is occurring
        Specified by:
        cancelTransfer in interface unlimited.core.transfers.TransferHandler
      • getTransferLength

        public long getTransferLength()
        Specified by:
        getTransferLength in interface unlimited.core.transfers.TransferHandler
        Returns:
        the length of the file currently being transferred
      • setBandwidth

        public int setBandwidth​(int bandwidth)
      • setBandwidthRemoteTransfer

        protected void setBandwidthRemoteTransfer​(int bandwidth)
      • setBandwidthFTPReceiver

        protected int setBandwidthFTPReceiver​(int bandwidth)
      • setBandwidthFTPTransmit

        protected int setBandwidthFTPTransmit​(int bandwidth,
                                              unlimited.core.transfers.io.MonitoredTransfer monitoredTransfer)
      • setBandwidthUPDReceiver

        protected int setBandwidthUPDReceiver​(int bandwidth)
      • setBandwidthUDPSender

        protected int setBandwidthUDPSender​(int bandwidth)
      • setCongestionControl

        public void setCongestionControl​(boolean congestionControl)
      • getStartRate

        public int getStartRate()
      • setStartRate

        public void setStartRate​(int startRate)
      • isCongestionControl

        public boolean isCongestionControl()
      • getNumFTPStreams

        public int getNumFTPStreams()
      • isUseCompression

        public boolean isUseCompression()
        Specified by:
        isUseCompression in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getCompStrategy

        public int getCompStrategy()
        Specified by:
        getCompStrategy in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getCompMethod

        public int getCompMethod()
      • getCompLevel

        public int getCompLevel()
        Specified by:
        getCompLevel in interface unlimited.core.transfers.io.FCClientEngineBridge
      • isAllowConnectNonFileCatalystServer

        public boolean isAllowConnectNonFileCatalystServer()
      • getWelcomeMessage

        public java.lang.String getWelcomeMessage()
      • getClientIdentifier

        public int getClientIdentifier()
      • getCongestionControlAggression

        public int getCongestionControlAggression()
      • setNumFTPStreams

        public void setNumFTPStreams​(int numFTPStreams)
      • setUseCompression

        public void setUseCompression​(boolean useCompression)
      • setCompMethod

        public void setCompMethod​(int compMethod)
      • setCompLevel

        public void setCompLevel​(int compLevel)
      • setCompStrategy

        @Deprecated
        public void setCompStrategy​(int compStrategy)
        Deprecated.
        We no longer support setting compression strategy.
        Parameters:
        compStrategy -
      • setReadTimeoutLong

        public void setReadTimeoutLong​(int millisecs)
        This is the timeout value that get set when we are sending commands that take long to execute, MD5, MKDLT, etc...
        Parameters:
        millisecs - int
      • setWelcomeMessage

        public void setWelcomeMessage​(java.lang.String welcomeMessage)
      • setClientIdentifier

        public void setClientIdentifier​(int clientIdentifier)
      • setCongestionControlAggression

        public void setCongestionControlAggression​(int congestionControlAggression)
      • addClientConnectKey

        public void addClientConnectKey​(java.lang.String key)
      • getNumUDPSockets

        public int getNumUDPSockets()
        Returns:
        the numUDPSockets
      • setNumUDPSockets

        public void setNumUDPSockets​(int numUDPSockets)
        Parameters:
        numUDPSockets - the numUDPSockets to set
      • getPacketLoss

        public double getPacketLoss()
        Specified by:
        getPacketLoss in interface unlimited.core.transfers.TransferHandler
      • getCurrentRTT

        public int getCurrentRTT()
      • isForceTCPmodeACKs

        public boolean isForceTCPmodeACKs()
        Returns:
        the forceTCPmodeACKs
      • setForceTCPmodeACKs

        public void setForceTCPmodeACKs​(boolean forceTCPmodeACKs)
        Parameters:
        forceTCPmodeACKs - the forceTCPmodeACKs to set
      • getServerAgentID

        public java.lang.String getServerAgentID()
        Specified by:
        getServerAgentID in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getClientAgentID

        public java.lang.String getClientAgentID()
        Specified by:
        getClientAgentID in interface unlimited.core.transfers.io.FCClientEngineBridge
      • setClientAgentID

        public void setClientAgentID​(java.lang.String clientAgentID)
        Specified by:
        setClientAgentID in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getSessionID

        public java.lang.String getSessionID()
        Specified by:
        getSessionID in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getClientSubIdentifier

        public int getClientSubIdentifier()
        Specified by:
        getClientSubIdentifier in interface unlimited.core.transfers.io.FCClientEngineBridge
        Returns:
        the clientSubIdentifier
      • setClientSubIdentifier

        public void setClientSubIdentifier​(int clientSubIdentifier)
        The sub identifier identifies this client as a sub component of a broader group of client apps. For example, client id 9 means FC Web, but doesn't indicate which applet is connecting. Or CLI identifier doesn't let you know if its Java or C++ CLI.
        Specified by:
        setClientSubIdentifier in interface unlimited.core.transfers.io.FCClientEngineBridge
        Parameters:
        clientSubIdentifier - the clientSubIdentifier to set
      • getClientString

        public java.lang.String getClientString()
        Specified by:
        getClientString in interface unlimited.core.transfers.io.FCClientEngineBridge
        Returns:
        the clientString
      • setClientString

        public void setClientString​(java.lang.String clientString)
        The client string provides additional information about the connecting client. For example in FC Web only one user account is used in Direct server. This value lets FC Web clients identify which FC Web user id is being used.
        Specified by:
        setClientString in interface unlimited.core.transfers.io.FCClientEngineBridge
        Parameters:
        clientString - the clientString to set
      • getReportManager

        public FCClientReportManager getReportManager()
        Returns the report manager that is used to encapsulate all reporting functionality into one single resource
        Returns:
        ReportManager object that allows individuals to perform reporting logic
      • getReporter

        public unlimited.fc.reporting.ClientDataReport getReporter()
        Specified by:
        getReporter in interface unlimited.core.transfers.io.FCClientEngineBridge
      • hasReporter

        public boolean hasReporter()
        Specified by:
        hasReporter in interface unlimited.core.transfers.io.FCClientEngineBridge
      • setClientName

        public void setClientName​(java.lang.String clientName)
        Parameters:
        clientName - the clientName to set
      • setClientWorkingPath

        public void setClientWorkingPath​(java.nio.file.Path clientWorkingPath)
        Parameters:
        clientName - the hotFolderName to set
        clientWorkingPath - TODO
      • getServletLocation

        public java.lang.String getServletLocation()
        Returns:
        the servletLocation
      • setServletLocation

        public void setServletLocation​(java.lang.String servletLocation)
        Parameters:
        servletLocation - the servletLocation to set
      • isHttp

        public boolean isHttp()
        Returns:
        the http
      • setHttp

        public void setHttp​(boolean http)
        Parameters:
        http - the http to set
      • getTransferSettings

        public unlimited.core.transfers.io.udptransfers.UDPTransferSettings getTransferSettings()
        Specified by:
        getTransferSettings in interface unlimited.core.transfers.io.FCClientEngineBridge
        Returns:
        the transferSettings
      • setProgressiveTransfer

        public void setProgressiveTransfer​(boolean isProgressive)
        This state is needed to suppress or allow a user data report to be written when the transfer completes. The transfer handler has this info. It should probably go into the transfer settings object.
      • isProgressiveTransfer

        public boolean isProgressiveTransfer()
      • setTransferSettings

        public void setTransferSettings​(unlimited.core.transfers.io.udptransfers.UDPTransferSettings transferSettings)
        Parameters:
        transferSettings - the transferSettings to set
      • getTransferMetrics

        public unlimited.core.transfers.UDPTransferMetricsContainer getTransferMetrics()
        Returns transfer metric container specific to UDP transfers. Statistics gathered by UDPTransmitter and UDPReceiver, and passed down the food chain by the ClientEngine -> TransferHook (Receive/Transmit Handler) -> Upload/Download Transfer classes If nothing is transferring, an empty container is passed through with stats values set to zero.
        Specified by:
        getTransferMetrics in interface unlimited.core.transfers.UDPTransferMetrics
        Returns:
        UDPTransferMetricsContainer
      • getRemoteServiceVersion

        public unlimited.core.util.common.version.RemoteServiceVersion getRemoteServiceVersion()
        Returns the remote service version of the server.
        Specified by:
        getRemoteServiceVersion in interface unlimited.core.util.common.version.KnowsRemoteServiceVersionInterface
        Returns:
      • remoteTransferInitiate

        public void remoteTransferInitiate​(ServerToServerTransferSettings settings)
                                    throws java.io.IOException,
                                           unlimited.core.util.common.exception.FCException
        Initiate a
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • createPatch

        public java.lang.String createPatch​(java.lang.String remoteFile,
                                            long offset,
                                            long length)
                                     throws java.io.IOException,
                                            unlimited.core.util.common.exception.FCException
        Creates a new patch file on the remote server that contains the bytes from offset to offeset+length of remoteFile
        Parameters:
        remoteFile -
        offset -
        length -
        Returns:
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • applyPatch

        public void applyPatch​(java.lang.String remoteFile,
                               java.lang.String remotePatch,
                               long offset)
                        throws java.io.IOException,
                               unlimited.core.util.common.exception.FCException
        Applies a patch file on the remote server to the specified file at the specified offset
        Parameters:
        remoteFile -
        remotePatch -
        offset -
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • remoteTransferStatus

        public java.lang.String remoteTransferStatus()
                                              throws unlimited.core.util.common.exception.FCException,
                                                     java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • zipErrors

        public boolean zipErrors()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • testApproximateUploadSpeed

        public int testApproximateUploadSpeed()
                                       throws unlimited.core.util.common.exception.FCException,
                                              java.io.IOException
        Performs a quick test to determine the approximate upload speed to the connected server.
        Returns:
        int the rate detected in Kbps
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • testApproximateDownloadSpeed

        public int testApproximateDownloadSpeed()
                                         throws unlimited.core.util.common.exception.FCException,
                                                java.io.IOException
        Performs a quick test to determine the approximate download speed to the connected server.
        Returns:
        int the rate detected in Kbps
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • testMaximumUploadSpeed

        public int testMaximumUploadSpeed()
                                   throws unlimited.core.util.common.exception.FCException,
                                          java.io.IOException
        Performs a quick test to determine the approximate upload speed to the connected server.
        Returns:
        int the rate detected in Kbps
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • testMaximumDownloadSpeed

        public int testMaximumDownloadSpeed()
                                     throws unlimited.core.util.common.exception.FCException,
                                            java.io.IOException
        Performs a quick test to determine the approximate download speed to the connected server.
        Returns:
        int the rate detected in Kbps
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • monitorIsNull

        public boolean monitorIsNull()
      • getSessionCount

        public int getSessionCount()
      • isLoggedIn

        public boolean isLoggedIn()
      • setVerifyMode

        public void setVerifyMode​(int verifyMode)
      • overrideSessionID

        public void overrideSessionID​(java.lang.String sessionID)
      • isComplete

        public boolean isComplete()
      • streamWithInlineParse

        public java.util.stream.Stream<FileListDataItem> streamWithInlineParse​(java.lang.String directory,
                                                                               FCClient fcClient)
                                                                        throws unlimited.core.util.common.exception.FCException,
                                                                               java.net.SocketException,
                                                                               java.io.UnsupportedEncodingException,
                                                                               java.io.UncheckedIOException,
                                                                               java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.net.SocketException
        java.io.UnsupportedEncodingException
        java.io.UncheckedIOException
        java.io.IOException
      • streamWithInlineParse

        public java.util.stream.Stream<FileListDataItem> streamWithInlineParse​(java.lang.String directory,
                                                                               FCClient fcClient,
                                                                               java.util.function.BooleanSupplier isCancelled)
                                                                        throws unlimited.core.util.common.exception.FCException,
                                                                               java.net.SocketException,
                                                                               java.io.UnsupportedEncodingException,
                                                                               java.io.UncheckedIOException,
                                                                               java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.net.SocketException
        java.io.UnsupportedEncodingException
        java.io.UncheckedIOException
        java.io.IOException
      • streamWithInlineParse

        public java.util.stream.Stream<FileListDataItem> streamWithInlineParse​(java.lang.String directory,
                                                                               java.util.function.BooleanSupplier isSynched,
                                                                               java.lang.AutoCloseable closer)
                                                                        throws unlimited.core.util.common.exception.FCException,
                                                                               java.net.SocketException,
                                                                               java.io.UnsupportedEncodingException,
                                                                               java.io.UncheckedIOException,
                                                                               java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.net.SocketException
        java.io.UnsupportedEncodingException
        java.io.UncheckedIOException
        java.io.IOException
      • streamWithInlineParse

        public java.util.stream.Stream<FileListDataItem> streamWithInlineParse​(java.lang.String directory,
                                                                               java.util.function.BooleanSupplier isSynched,
                                                                               java.lang.AutoCloseable closer,
                                                                               java.util.function.BooleanSupplier isCancelled)
                                                                        throws unlimited.core.util.common.exception.FCException,
                                                                               java.net.SocketException,
                                                                               java.io.UnsupportedEncodingException,
                                                                               java.io.UncheckedIOException,
                                                                               java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.net.SocketException
        java.io.UnsupportedEncodingException
        java.io.UncheckedIOException
        java.io.IOException
      • exists

        public unlimited.core.util.common.AutoClose<unlimited.core.util.common.stream.PairStream<java.lang.String,​java.lang.Boolean>> exists​(java.util.stream.Stream<java.lang.String> nameStream)
      • getUserEmail

        public java.lang.String getUserEmail()
                                      throws java.io.IOException,
                                             unlimited.core.util.common.exception.FCException
        Returns The User's Email Address When Requested
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • setUserEmail

        public void setUserEmail​(java.lang.String newEmail)
                          throws java.io.IOException
        Sets the user's email address
        Parameters:
        newEmail - - The New Email Address To Be Set
        Throws:
        java.io.IOException
      • getUserFullName

        public java.lang.String getUserFullName()
                                         throws unlimited.core.util.common.exception.FCException,
                                                java.io.IOException
        Gathers The Full Name Of The User
        Returns:
        - The Full Name Of The User
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • setUserFullName

        public void setUserFullName​(java.lang.String newName)
                             throws unlimited.core.util.common.exception.FCException,
                                    java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • getUserPermissions

        public UserPermissionsContainer getUserPermissions()
                                                    throws unlimited.core.util.common.exception.FCException,
                                                           java.io.IOException
        Gathers The User's Permissions From The Server
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • sendWeblink

        public WeblinkResult sendWeblink​(WeblinkDataContainer linkDO)
                                  throws unlimited.core.util.common.exception.FCException,
                                         java.io.IOException
        Creates A Weblink From The Data Container Given
        Parameters:
        linkDO - - Data Container Containing Data For The Link
        Throws:
        java.io.IOException
        unlimited.core.util.common.exception.FCException
      • validateLinkDataContainer

        protected void validateLinkDataContainer​(WeblinkDataContainer linkDO)
                                          throws unlimited.core.util.common.exception.FCException
        Throws:
        unlimited.core.util.common.exception.FCException
      • buildWeblinkCommand

        protected java.lang.String buildWeblinkCommand​(WeblinkDataContainer linkDO)
      • sendJobStatus

        public void sendJobStatus​(TransferStatusEnum status)
                           throws unlimited.core.util.common.exception.FCException,
                                  java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • isLinkEnabledOnServer

        public boolean isLinkEnabledOnServer()
                                      throws unlimited.core.util.common.exception.FCException,
                                             java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • getServerLinkExpiryDayValue

        public int getServerLinkExpiryDayValue()
                                        throws unlimited.core.util.common.exception.FCException,
                                               java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • getServerConfigurationValue

        public java.lang.String getServerConfigurationValue​(java.lang.String request)
                                                     throws unlimited.core.util.common.exception.FCException,
                                                            java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • getAllServerClientConfigs

        public ServerConfigs getAllServerClientConfigs()
                                                throws unlimited.core.util.common.exception.FCException,
                                                       java.io.IOException
        Throws:
        unlimited.core.util.common.exception.FCException
        java.io.IOException
      • getCachedPWD

        public java.lang.String getCachedPWD()
      • getIsTransferringData

        public boolean getIsTransferringData()
      • updateReportWriter

        public void updateReportWriter​(java.lang.String transferType,
                                       java.lang.String transferDirection,
                                       long size,
                                       java.nio.file.Path localFile)
        Specified by:
        updateReportWriter in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getTransmitZipRatio

        public float getTransmitZipRatio()
      • setSessionPriority

        public void setSessionPriority​(int priority)
      • lastServerRestrictedRate

        public int lastServerRestrictedRate()
      • isServerBandwidthOverride

        public boolean isServerBandwidthOverride()
      • getHashCode

        public com.google.common.hash.HashCode getHashCode()
      • getTransferID

        public int getTransferID()
        Specified by:
        getTransferID in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getForceFileOwnerConfig

        public unlimited.core.util.common.forceFileOwnership.ForceFileOwnershipConfig getForceFileOwnerConfig()
        Specified by:
        getForceFileOwnerConfig in interface unlimited.core.transfers.io.FCClientEngineBridge
      • hasAutoDetectData

        public boolean hasAutoDetectData()
      • setAutoDetectData

        public void setAutoDetectData​(FCClient fcClient)
      • ctrlClient

        public unlimited.core.transfers.io.FCClientControlSocketBridge ctrlClient()
        Specified by:
        ctrlClient in interface unlimited.core.transfers.io.FCClientEngineBridge
      • numFTPStreams

        public int numFTPStreams()
        Specified by:
        numFTPStreams in interface unlimited.core.transfers.io.FCClientEngineBridge
      • numFTPStreams

        public void numFTPStreams​(int streams)
        Specified by:
        numFTPStreams in interface unlimited.core.transfers.io.FCClientEngineBridge
      • lastValidReply

        public void lastValidReply​(unlimited.core.transfers.io.FCReply validateReply)
        Specified by:
        lastValidReply in interface unlimited.core.transfers.io.FCClientEngineBridge
      • lastValidReply

        public unlimited.core.transfers.io.FCReply lastValidReply()
        Specified by:
        lastValidReply in interface unlimited.core.transfers.io.FCClientEngineBridge
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception
      • isAborted

        public void isAborted​(boolean isAborted)
        Specified by:
        isAborted in interface unlimited.core.transfers.io.FCClientEngineBridge
      • abortAck

        public void abortAck​(boolean abortAck)
        Specified by:
        abortAck in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getDone

        public boolean getDone()
        Specified by:
        getDone in interface unlimited.core.transfers.io.FCClientEngineBridge
      • getDone

        public void getDone​(boolean isDone)
        Specified by:
        getDone in interface unlimited.core.transfers.io.FCClientEngineBridge
      • readTimeout

        public int readTimeout()
        Specified by:
        readTimeout in interface unlimited.core.transfers.io.FCClientEngineBridge
      • readTimeout

        public void readTimeout​(int readTimeout)
        Specified by:
        readTimeout in interface unlimited.core.transfers.io.FCClientEngineBridge
      • putDone

        public void putDone​(boolean putDone)
        Specified by:
        putDone in interface unlimited.core.transfers.io.FCClientEngineBridge
      • putDone

        public boolean putDone()
        Specified by:
        putDone in interface unlimited.core.transfers.io.FCClientEngineBridge
      • waitingForAbortAck

        public void waitingForAbortAck​(boolean waitingForAbortAck)
        Specified by:
        waitingForAbortAck in interface unlimited.core.transfers.io.FCClientEngineBridge
      • setSslSocketProducer

        public void setSslSocketProducer​(unlimited.core.util.common.net.ssl.FCSSLSocketProducerImpl sslSocketProducer)
        Specified by:
        setSslSocketProducer in interface unlimited.core.transfers.io.FCClientEngineBridge
      • setCurrentFilesMatch

        public void setCurrentFilesMatch​(FilesMatch filesMatch)