Class TransferHook

  • All Implemented Interfaces:
    unlimited.core.transfers.UDPTransferMetrics, TransferState
    Direct Known Subclasses:
    MultiClientTransferHook, MultiTransferHandler, SnapShotHook, ThreadSafeMultiHook

    public abstract class TransferHook
    extends java.util.Observable
    implements unlimited.core.transfers.UDPTransferMetrics, TransferState
    This interface provides a hook into the status of FileCatalyst transfers. This class is also observable, and will update registered observers upon each status change. The current status may be obtained by calling getStatus(). The returned codes will correspond to one of the status constants defined in this class. A corresponding message can be obtained using the getStatusMessage() method.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int BIDIRECTIONAL
      This direction indicates the current transfer is in both a download and upload
      static int CANCELLED
      This status code means the transfer was cancelled (2)
      static int CHECKING
      This status code means this handler is checking the status of a file prior to transferring (12)
      static int COMPRESSING
      This status code means this handler is currently compressing a file (not yet implemented) (6)
      static int CREATINGDMG
      This status code means this handle is rebuilding the file or issuing the rebuild file command to the server (16)
      protected java.util.Map<java.lang.String,​java.lang.Integer> currentFileToIDs  
      static int DECOMPRESSING
      This status code means the connection is in a decompressing state (19)
      static int DELTA
      This status code means this handler is creating delta file or issuing the delta command to the server (14)
      static int DOINGCHMOD
      This status code means this handler is currently changing the permissions on a file (9)
      static int DOINGMDTM
      This status code means this handler is currently updating the Date/Time stamp on a file (8)
      static int DONEFILE
      This status code means this handler is done transferring the current file (11)
      static int DOWNLOAD
      This direction indicates the current transfer is a download
      static int ERROR
      This status code means the transfer failed with an error (3)
      protected java.util.LinkedList<ErrorCodes> errorMessageStack  
      static int FINISHED
      This status code means this handler is finished all files (10)
      static int IDLE
      This status code means the connection is in an idle state (54)
      static int INITIALIZING
      This status code means this handler is currently initializing a transfer (7)
      static int MONITORING
      This status code means the connection is in a monitoring state (20)
      static int MOVINGFILES
      This status code means this handle is int HTTP mode, and the FTP server didn't support APPE commands, and thus the files are being moved to the FTP server with one STOR command (17)
      static int NOTATTEMPTED
      This status code means the transfer was not attempted (0)
      static int PROCESSING
      This status code means the connection is in a processing state (55)
      static int REBUILD
      This status code means this handle is rebuilding the file or issuing the rebuild file command to the server (15)
      static int RECONNECTING
      This status code means the connection has been lost, and is currently in a retry loop.
      static int SIGNATURE
      This status code means this handler is creating signature or issuing the signature command to the server (13)
      static int SUCCESS
      This status code means the transfer was successful (1)
      static int TRANSFERRING
      This status code means this handler is currently transferring a file (4)
      static int UPLOAD
      This direction indicates the current transfer is a upload
      static int VERIFYING
      This status code means this handler is currently verifying the integrity of a file (5)
    • Constructor Summary

      Constructors 
      Constructor Description
      TransferHook()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addErrorMessage​(ErrorCodes newError)
      Add a new error onto the stack.
      void addObserver​(java.util.Observer o)
      Deprecated.
      int getActualRate()
      Deprecated.
      Method deprecated.
      ErrorCodes[] getAllErrorMessages()
      Cycle through all errors in the stack and return them.
      java.util.List<java.lang.String> getAllFilePaths()
      Returns a list of all file paths contained within this TransferHook
      long getBytesSoFarAllFiles()
      Returns the number of bytes transferred so far for all files.
      long getBytesSoFarCurrentFile()
      Returns the number of bytes transferred so far for the current file.
      int getCountTransferred()
      Returns the number of files that were actually transferred.
      int getCurrentEffectiveRate()
      Returns the rate for the current file in Kbps.
      java.lang.String getCurrentFilename()
      Returns the name of the file currently being transferred.
      java.util.Map<java.lang.String,​java.lang.Integer> getCurrentFileToIDs()
      Returns a list of IDs for the files
      long getCurrentFileTransferTime()
      Returns the transfer time for the current file in milliseconds
      int getCurrentPercent()
      Returns the percent complete for the current file
      int getCurrentRate()
      Returns the rate in the last second for the current file in Kbps.
      int getDirection()
      Returns either UPLOAD or DOWNLOAD constant depending on the direction of this transfer
      int getEffectiveRateAverage()
      Returns the effective rate for the current file in Kbps as an average over last 30 seconds.
      ErrorCodes getErrorCodes()
      Returns the last error codes placed into the stack.
      java.lang.String getErrorMessage()
      Legacy method to get error messages.
      java.util.Set<ErrorCodes> getErrorSet()
      Returns the set of error codes for all error messages in this TransferHooks
      int getFilesSoFar()
      Returns the number of files transferred so far.
      java.util.List<java.lang.String> getFilesTransferredLocal()
      Returns a List containing the full local paths (Strings) of all files that were transferred.
      java.util.List<java.lang.String> getFilesTransferredRemote()
      Returns a List containing the full remote paths (Strings) of all files that were transferred.
      java.lang.String getFormattedCurrentFileTransferTime()
      Returns a human readable file transfer time
      java.lang.String getFormattedOverallTransferTime()
      Returns the time taken to transfer all files formatted to a String i.e 5 mins 21 secs
      java.lang.String getFormattedTransferTime()
      Returns the time taken to transfer the current file formatted to a String i.e 5 mins 21 secs
      java.lang.String getLocalFilename()
      Returns the full path of the local file currently being transferred
      int getMeanEffectiveRate()
      Returns the rate for the current file in Kbps.
      int getOverallRate()
      Returns the average rate (in Kbps) spanned over all files averaged over the entire transfer.
      double getOverallRateInKBperSecond()
      Returns the average rate (in KB/s) spanned over all files averageed over the entire transfer.
      java.lang.String getOverallTimeRemaining()
      Return the time remaining for the all files formatted to a String i.e 5 mins 21 secs
      long getOverallTimeRemainingMillis()
      Returns the time remaining in milliseconds for all files
      long getOverallTransferTime()
      Returns the time taken to transfer all files so far in milliseconds
      double getPacketLossPercent()
      Returns the packet loss percent for the current transfer.
      int getPercent()
      Returns the percentage complete of all files to be transferred
      int getRate()
      Deprecated.
      int getRateAverage()
      Returns the network rate for the current file in Kbps as an average over last 30 seconds.
      double getRateAverageInKBperSecond()
      Returns the rate for the current file in KB/s as an average over last 30 seconds
      double getRateInKBperSecond()
      Returns the rate for the current file in KB/s
      java.lang.String getRemoteFilename()
      Returns the full path of the remote file currently being transferred
      int getRoundTripTime()
      Returns the current round trip time
      long getSizeAllFiles()
      Returns the total size in bytes of all files that will be transferred
      long getSizeCurrentFile()
      Returns the size in bytes of the file currently being transferred.
      long getSizeTransferredAlreadyAllFiles()
      Returns the number of bytes that were already transferred for all files (usually due to a resume)
      long getSizeTransferredAlreadyCurrentFile()
      Returns the number of bytes that were already transferred for this file (usually due to a resume)
      SnapShotHook getSnapShot()
      Creates and returns a read-only snapshot of the current hook information
      java.lang.String getStatusAsParsableString()  
      int getStatusCode()
      Returns the current status code, indicates what is currently happening with the transfer
      java.lang.String getStatusMessage()
      Returns a String representation of the current status of this transfer handler.
      java.lang.String getTimeRemaining()
      Return the time remaining for the current file formatted to a String i.e 5 mins 21 secs
      long getTimeRemainingMillis()
      Returns the time remaining in milliseconds for the current file
      int getTotalFiles()
      Returns the total number of files to be transferred.
      unlimited.core.transfers.UDPTransferMetricsContainer getTransferMetrics()  
      int getTransferMode()
      Returns the current transfer mode
      long getTransferStartTime()
      Returns the transfer start time for the total transfer in milliseconds
      java.util.List<java.lang.Integer> getTransferStatus()
      Returns a list of all the status codes for current transfers within this TransferHook
      long getTransferTime()
      Returns the transfer time for the total transfer in milliseconds
      java.lang.String getTransferWarningMessage()
      Returns the transfer warning message if a transfer warning has occurred.
      boolean isFatal()
      Return true if a fatal error has occurred
      boolean isSecure()
      Returns true if transfer is secure
      abstract boolean isTransferCancelled()
      Returns true if the transfer was cancelled.
      abstract boolean isTransferComplete()
      Returns true if all files are successfully transferred
      abstract boolean isTransferError()
      Returns true if an error occured
      boolean isTransferWarning()
      Returns true a recoverable transfer warning has occured.
      void killAll()  
      void setCancelled()
      Calling this method will cancel the current transfer.
      void setFormatter​(unlimited.core.util.common.formatter.Formatter formatter)
      Sets the formatter information to the values of this object
      • Methods inherited from class java.util.Observable

        clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
      • Methods inherited from class java.lang.Object

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

      • NOTATTEMPTED

        public static final int NOTATTEMPTED
        This status code means the transfer was not attempted (0)
        See Also:
        Constant Field Values
      • SUCCESS

        public static final int SUCCESS
        This status code means the transfer was successful (1)
        See Also:
        Constant Field Values
      • CANCELLED

        public static final int CANCELLED
        This status code means the transfer was cancelled (2)
        See Also:
        Constant Field Values
      • ERROR

        public static final int ERROR
        This status code means the transfer failed with an error (3)
        See Also:
        Constant Field Values
      • TRANSFERRING

        public static final int TRANSFERRING
        This status code means this handler is currently transferring a file (4)
        See Also:
        Constant Field Values
      • VERIFYING

        public static final int VERIFYING
        This status code means this handler is currently verifying the integrity of a file (5)
        See Also:
        Constant Field Values
      • COMPRESSING

        public static final int COMPRESSING
        This status code means this handler is currently compressing a file (not yet implemented) (6)
        See Also:
        Constant Field Values
      • INITIALIZING

        public static final int INITIALIZING
        This status code means this handler is currently initializing a transfer (7)
        See Also:
        Constant Field Values
      • DOINGMDTM

        public static final int DOINGMDTM
        This status code means this handler is currently updating the Date/Time stamp on a file (8)
        See Also:
        Constant Field Values
      • DOINGCHMOD

        public static final int DOINGCHMOD
        This status code means this handler is currently changing the permissions on a file (9)
        See Also:
        Constant Field Values
      • FINISHED

        public static final int FINISHED
        This status code means this handler is finished all files (10)
        See Also:
        Constant Field Values
      • DONEFILE

        public static final int DONEFILE
        This status code means this handler is done transferring the current file (11)
        See Also:
        Constant Field Values
      • CHECKING

        public static final int CHECKING
        This status code means this handler is checking the status of a file prior to transferring (12)
        See Also:
        Constant Field Values
      • SIGNATURE

        public static final int SIGNATURE
        This status code means this handler is creating signature or issuing the signature command to the server (13)
        See Also:
        Constant Field Values
      • DELTA

        public static final int DELTA
        This status code means this handler is creating delta file or issuing the delta command to the server (14)
        See Also:
        Constant Field Values
      • REBUILD

        public static final int REBUILD
        This status code means this handle is rebuilding the file or issuing the rebuild file command to the server (15)
        See Also:
        Constant Field Values
      • CREATINGDMG

        public static final int CREATINGDMG
        This status code means this handle is rebuilding the file or issuing the rebuild file command to the server (16)
        See Also:
        Constant Field Values
      • MOVINGFILES

        public static final int MOVINGFILES
        This status code means this handle is int HTTP mode, and the FTP server didn't support APPE commands, and thus the files are being moved to the FTP server with one STOR command (17)
        See Also:
        Constant Field Values
      • RECONNECTING

        public static final int RECONNECTING
        This status code means the connection has been lost, and is currently in a retry loop. (18)
        See Also:
        Constant Field Values
      • DECOMPRESSING

        public static final int DECOMPRESSING
        This status code means the connection is in a decompressing state (19)
        See Also:
        Constant Field Values
      • MONITORING

        public static final int MONITORING
        This status code means the connection is in a monitoring state (20)
        See Also:
        Constant Field Values
      • UPLOAD

        public static final int UPLOAD
        This direction indicates the current transfer is a upload
        See Also:
        Constant Field Values
      • DOWNLOAD

        public static final int DOWNLOAD
        This direction indicates the current transfer is a download
        See Also:
        Constant Field Values
      • BIDIRECTIONAL

        public static final int BIDIRECTIONAL
        This direction indicates the current transfer is in both a download and upload
        See Also:
        Constant Field Values
      • IDLE

        public static final int IDLE
        This status code means the connection is in an idle state (54)
        See Also:
        Constant Field Values
      • PROCESSING

        public static final int PROCESSING
        This status code means the connection is in a processing state (55)
        See Also:
        Constant Field Values
      • errorMessageStack

        protected java.util.LinkedList<ErrorCodes> errorMessageStack
      • currentFileToIDs

        protected java.util.Map<java.lang.String,​java.lang.Integer> currentFileToIDs
    • Constructor Detail

      • TransferHook

        public TransferHook()
    • Method Detail

      • getRate

        @Deprecated
        public int getRate()
        Deprecated.
        Returns the rate for the current file in Kbps. This is the average rate for the current file. you should use getMeanEffectiveRate() instead
        Returns:
        the rate for the current file in Kbps
      • getActualRate

        @Deprecated
        public int getActualRate()
        Deprecated.
        Method deprecated. Use getMeanEffectiveRate() instead
        Returns the rate for the current file in Kbps. This is the average rate for the current file. you should use getMeanEffectiveRate() instead
        Returns:
        the rate for the current file in Kbps
      • isTransferComplete

        public abstract boolean isTransferComplete()
        Description copied from interface: TransferState
        Returns true if all files are successfully transferred
        Specified by:
        isTransferComplete in interface TransferState
        Returns:
        true if all files are successfully transferred
      • isTransferCancelled

        public abstract boolean isTransferCancelled()
        Description copied from interface: TransferState
        Returns true if the transfer was cancelled.
        Specified by:
        isTransferCancelled in interface TransferState
        Returns:
        true if the transfer was cancelled.
      • isTransferError

        public abstract boolean isTransferError()
        Description copied from interface: TransferState
        Returns true if an error occured
        Specified by:
        isTransferError in interface TransferState
        Returns:
        true if an error occured
      • isFatal

        public boolean isFatal()
        Return true if a fatal error has occurred
        Returns:
      • getStatusAsParsableString

        public java.lang.String getStatusAsParsableString()
      • getSnapShot

        public SnapShotHook getSnapShot()
        Creates and returns a read-only snapshot of the current hook information
        Returns:
        returns a read only snapshot of the current hook
      • addErrorMessage

        public void addErrorMessage​(ErrorCodes newError)
        Add a new error onto the stack.
        Parameters:
        newError - ErrorCodes
      • getAllErrorMessages

        public ErrorCodes[] getAllErrorMessages()
        Cycle through all errors in the stack and return them.
        Returns:
        ErrorCodes[]
      • getErrorCodes

        public ErrorCodes getErrorCodes()
        Returns the last error codes placed into the stack.
        Returns:
        ErrorCodes
      • getErrorMessage

        public java.lang.String getErrorMessage()
        Legacy method to get error messages.
        Returns:
        String
      • setFormatter

        public void setFormatter​(unlimited.core.util.common.formatter.Formatter formatter)
        Sets the formatter information to the values of this object
        Parameters:
        formatter - Formatter to set
      • getErrorSet

        public java.util.Set<ErrorCodes> getErrorSet()
        Returns the set of error codes for all error messages in this TransferHooks
        Returns:
        Set containing all the ErrorCodes
      • getCurrentFileToIDs

        public java.util.Map<java.lang.String,​java.lang.Integer> getCurrentFileToIDs()
        Returns a list of IDs for the files
        Returns:
      • getTotalFiles

        public int getTotalFiles()
        Description copied from interface: TransferState
        Returns the total number of files to be transferred.
        Specified by:
        getTotalFiles in interface TransferState
        Returns:
        the total number of files to be transferred.
      • setCancelled

        public void setCancelled()
        Description copied from interface: TransferState
        Calling this method will cancel the current transfer. This method will block until the transfer is actually cancelled.
        Specified by:
        setCancelled in interface TransferState
      • getFilesSoFar

        public int getFilesSoFar()
        Description copied from interface: TransferState
        Returns the number of files transferred so far. This includes files that were skipped because incremental is enabled and the file has not been changed.
        Specified by:
        getFilesSoFar in interface TransferState
        Returns:
        the number of files transferred so far.
      • getStatusMessage

        public java.lang.String getStatusMessage()
        Description copied from interface: TransferState
        Returns a String representation of the current status of this transfer handler.
        Specified by:
        getStatusMessage in interface TransferState
        Returns:
        A String representation of the current status of this transfer handler.
      • getSizeTransferredAlreadyCurrentFile

        public long getSizeTransferredAlreadyCurrentFile()
        Description copied from interface: TransferState
        Returns the number of bytes that were already transferred for this file (usually due to a resume)
        Specified by:
        getSizeTransferredAlreadyCurrentFile in interface TransferState
        Returns:
        long the number of bytes that were already transferred for this file (usually due to a resume)
      • getSizeTransferredAlreadyAllFiles

        public long getSizeTransferredAlreadyAllFiles()
        Description copied from interface: TransferState
        Returns the number of bytes that were already transferred for all files (usually due to a resume)
        Specified by:
        getSizeTransferredAlreadyAllFiles in interface TransferState
        Returns:
        long the number of bytes that were already transferred for all files (usually due to a resume)
      • getBytesSoFarCurrentFile

        public long getBytesSoFarCurrentFile()
        Description copied from interface: TransferState
        Returns the number of bytes transferred so far for the current file.
        Specified by:
        getBytesSoFarCurrentFile in interface TransferState
        Returns:
        the number of bytes transferred so far for the current file (excluding data skipped due to resume).
      • getSizeCurrentFile

        public long getSizeCurrentFile()
        Description copied from interface: TransferState
        Returns the size in bytes of the file currently being transferred.
        Specified by:
        getSizeCurrentFile in interface TransferState
        Returns:
        the size in bytes of the file currently being transferred.
      • getSizeAllFiles

        public long getSizeAllFiles()
        Description copied from interface: TransferState
        Returns the total size in bytes of all files that will be transferred
        Specified by:
        getSizeAllFiles in interface TransferState
        Returns:
        the total size in bytes of all files that will be transferred
      • getBytesSoFarAllFiles

        public long getBytesSoFarAllFiles()
        Description copied from interface: TransferState
        Returns the number of bytes transferred so far for all files.
        Specified by:
        getBytesSoFarAllFiles in interface TransferState
        Returns:
        the number of bytes transferred so far for all files (excluding data skipped due to resume).
      • getPercent

        public int getPercent()
        Description copied from interface: TransferState
        Returns the percentage complete of all files to be transferred
        Specified by:
        getPercent in interface TransferState
        Returns:
        the percentage complete of all files to be transferred
      • getCurrentPercent

        public int getCurrentPercent()
        Description copied from interface: TransferState
        Returns the percent complete for the current file
        Specified by:
        getCurrentPercent in interface TransferState
        Returns:
        the percent complete for the current file
      • getOverallRate

        public int getOverallRate()
        Description copied from interface: TransferState
        Returns the average rate (in Kbps) spanned over all files averaged over the entire transfer.
        Specified by:
        getOverallRate in interface TransferState
        Returns:
        rate in Kbps
      • getCurrentEffectiveRate

        public int getCurrentEffectiveRate()
        Description copied from interface: TransferState
        Returns the rate for the current file in Kbps. This is the current rate for the current file.
        Specified by:
        getCurrentEffectiveRate in interface TransferState
        Returns:
        the rate for the current file in Kbps
      • getMeanEffectiveRate

        public int getMeanEffectiveRate()
        Description copied from interface: TransferState
        Returns the rate for the current file in Kbps. This is the average rate for the current file.
        Specified by:
        getMeanEffectiveRate in interface TransferState
        Returns:
        the rate for the current file in Kbps
      • getRateAverage

        public int getRateAverage()
        Description copied from interface: TransferState
        Returns the network rate for the current file in Kbps as an average over last 30 seconds.
        Specified by:
        getRateAverage in interface TransferState
        Returns:
        the rate for the current file in Kbps
      • getEffectiveRateAverage

        public int getEffectiveRateAverage()
        Description copied from interface: TransferState
        Returns the effective rate for the current file in Kbps as an average over last 30 seconds.
        Specified by:
        getEffectiveRateAverage in interface TransferState
        Returns:
        the effective rate for the current file in Kbps
      • getRateInKBperSecond

        public double getRateInKBperSecond()
        Description copied from interface: TransferState
        Returns the rate for the current file in KB/s
        Specified by:
        getRateInKBperSecond in interface TransferState
        Returns:
        the rate for the current file in KB/s
      • getRateAverageInKBperSecond

        public double getRateAverageInKBperSecond()
        Description copied from interface: TransferState
        Returns the rate for the current file in KB/s as an average over last 30 seconds
        Specified by:
        getRateAverageInKBperSecond in interface TransferState
        Returns:
        the rate for the current file in KB/s
      • getOverallRateInKBperSecond

        public double getOverallRateInKBperSecond()
        Description copied from interface: TransferState
        Returns the average rate (in KB/s) spanned over all files averageed over the entire transfer.
        Specified by:
        getOverallRateInKBperSecond in interface TransferState
        Returns:
        rate in KB/s
      • getTimeRemainingMillis

        public long getTimeRemainingMillis()
        Description copied from interface: TransferState
        Returns the time remaining in milliseconds for the current file
        Specified by:
        getTimeRemainingMillis in interface TransferState
        Returns:
        the time remaining in milliseconds for the current file
      • getOverallTimeRemainingMillis

        public long getOverallTimeRemainingMillis()
        Description copied from interface: TransferState
        Returns the time remaining in milliseconds for all files
        Specified by:
        getOverallTimeRemainingMillis in interface TransferState
        Returns:
        the time remaining in milliseconds for all files
      • getTimeRemaining

        public java.lang.String getTimeRemaining()
        Description copied from interface: TransferState
        Return the time remaining for the current file formatted to a String i.e 5 mins 21 secs
        Specified by:
        getTimeRemaining in interface TransferState
        Returns:
        the time remaining for the current file formatted to a String
      • getOverallTimeRemaining

        public java.lang.String getOverallTimeRemaining()
        Description copied from interface: TransferState
        Return the time remaining for the all files formatted to a String i.e 5 mins 21 secs
        Specified by:
        getOverallTimeRemaining in interface TransferState
        Returns:
        the time remaining for the all files formatted to a String
      • getOverallTransferTime

        public long getOverallTransferTime()
        Description copied from interface: TransferState
        Returns the time taken to transfer all files so far in milliseconds
        Specified by:
        getOverallTransferTime in interface TransferState
        Returns:
        the time taken to transfer all files so far in milliseconds
      • getFormattedOverallTransferTime

        public java.lang.String getFormattedOverallTransferTime()
        Description copied from interface: TransferState
        Returns the time taken to transfer all files formatted to a String i.e 5 mins 21 secs
        Specified by:
        getFormattedOverallTransferTime in interface TransferState
        Returns:
        the time taken to transfer all files formatted to a String i.e 5 mins 21 secs
      • getFormattedTransferTime

        public java.lang.String getFormattedTransferTime()
        Description copied from interface: TransferState
        Returns the time taken to transfer the current file formatted to a String i.e 5 mins 21 secs
        Specified by:
        getFormattedTransferTime in interface TransferState
        Returns:
        the time taken to transfer the current file formatted to a String i.e 5 mins 21 secs
      • getTransferWarningMessage

        public java.lang.String getTransferWarningMessage()
        Description copied from interface: TransferState
        Returns the transfer warning message if a transfer warning has occurred.
        Specified by:
        getTransferWarningMessage in interface TransferState
        Returns:
        String the warning message
      • getStatusCode

        public int getStatusCode()
        Description copied from interface: TransferState
        Returns the current status code, indicates what is currently happening with the transfer
        Specified by:
        getStatusCode in interface TransferState
        Returns:
        the current status code
      • getCurrentFilename

        public java.lang.String getCurrentFilename()
        Description copied from interface: TransferState
        Returns the name of the file currently being transferred.
        Specified by:
        getCurrentFilename in interface TransferState
        Returns:
        the name of the file currently being transferred.
      • getLocalFilename

        public java.lang.String getLocalFilename()
        Description copied from interface: TransferState
        Returns the full path of the local file currently being transferred
        Specified by:
        getLocalFilename in interface TransferState
        Returns:
        the full path of the local file currently being transferred
      • getRemoteFilename

        public java.lang.String getRemoteFilename()
        Description copied from interface: TransferState
        Returns the full path of the remote file currently being transferred
        Specified by:
        getRemoteFilename in interface TransferState
        Returns:
        the full path of the remote file currently being transferred
      • getTransferTime

        public long getTransferTime()
        Description copied from interface: TransferState
        Returns the transfer time for the total transfer in milliseconds
        Specified by:
        getTransferTime in interface TransferState
        Returns:
        the transfer time for the total transfer in milliseconds
      • getTransferStartTime

        public long getTransferStartTime()
        Description copied from interface: TransferState
        Returns the transfer start time for the total transfer in milliseconds
        Specified by:
        getTransferStartTime in interface TransferState
        Returns:
        the transfer start time for the total transfer in milliseconds
      • getCurrentFileTransferTime

        public long getCurrentFileTransferTime()
        Description copied from interface: TransferState
        Returns the transfer time for the current file in milliseconds
        Specified by:
        getCurrentFileTransferTime in interface TransferState
        Returns:
        the transfer time for the current file in milliseconds
      • getCountTransferred

        public int getCountTransferred()
        Description copied from interface: TransferState
        Returns the number of files that were actually transferred. This differs from getFilesSofar() in that it only includes files that actually got transferred. Some may be skipped because incremental is set to true and had not changed on the server.
        Specified by:
        getCountTransferred in interface TransferState
        Returns:
        number of files actually transferred
      • getPacketLossPercent

        public double getPacketLossPercent()
        Description copied from interface: TransferState
        Returns the packet loss percent for the current transfer. Always returns 0 for non-UDP transfers.
        Specified by:
        getPacketLossPercent in interface TransferState
        Returns:
        packet loss percentage for current transfer
      • getRoundTripTime

        public int getRoundTripTime()
        Description copied from interface: TransferState
        Returns the current round trip time
        Specified by:
        getRoundTripTime in interface TransferState
        Returns:
        the current round trip time
      • getFilesTransferredRemote

        public java.util.List<java.lang.String> getFilesTransferredRemote()
        Description copied from interface: TransferState
        Returns a List containing the full remote paths (Strings) of all files that were transferred. Calling this method through JavaScript to the applet will return a String delimited by the default delimiter, or whatever delimiter was specified via the applet "delimiter" param
        Specified by:
        getFilesTransferredRemote in interface TransferState
        Returns:
        List containing the full remote paths (Strings) of all files that were transferred.
      • getFilesTransferredLocal

        public java.util.List<java.lang.String> getFilesTransferredLocal()
        Description copied from interface: TransferState
        Returns a List containing the full local paths (Strings) of all files that were transferred. Calling this method through JavaScript to the applet will return a String delimited by the default delimiter, or whatever delimiter was specified via the applet "delimiter" param
        Specified by:
        getFilesTransferredLocal in interface TransferState
        Returns:
        List containing the full local paths (Strings) of all files that were transferred.
      • getDirection

        public int getDirection()
        Description copied from interface: TransferState
        Returns either UPLOAD or DOWNLOAD constant depending on the direction of this transfer
        Specified by:
        getDirection in interface TransferState
        Returns:
        either UPLOAD or DOWNLOAD constant depending on the direction of this transfer
      • getTransferMode

        public int getTransferMode()
        Description copied from interface: TransferState
        Returns the current transfer mode
        Specified by:
        getTransferMode in interface TransferState
        Returns:
        current transfer mode
      • isSecure

        public boolean isSecure()
        Description copied from interface: TransferState
        Returns true if transfer is secure
        Specified by:
        isSecure in interface TransferState
        Returns:
        true if transfer is secure
      • getTransferStatus

        public java.util.List<java.lang.Integer> getTransferStatus()
        Description copied from interface: TransferState
        Returns a list of all the status codes for current transfers within this TransferHook
        Specified by:
        getTransferStatus in interface TransferState
        Returns:
      • getAllFilePaths

        public java.util.List<java.lang.String> getAllFilePaths()
        Description copied from interface: TransferState
        Returns a list of all file paths contained within this TransferHook
        Specified by:
        getAllFilePaths in interface TransferState
        Returns:
      • getFormattedCurrentFileTransferTime

        public java.lang.String getFormattedCurrentFileTransferTime()
        Description copied from interface: TransferState
        Returns a human readable file transfer time
        Specified by:
        getFormattedCurrentFileTransferTime in interface TransferState
        Returns:
        Human readable transfer time
      • getCurrentRate

        public int getCurrentRate()
        Description copied from interface: TransferState
        Returns the rate in the last second for the current file in Kbps.
        Specified by:
        getCurrentRate in interface TransferState
        Returns:
        the rate for the current file in Kbps over the past second.
      • isTransferWarning

        public boolean isTransferWarning()
        Description copied from interface: TransferState
        Returns true a recoverable transfer warning has occured.
        Specified by:
        isTransferWarning in interface TransferState
        Returns:
        boolean true if a recoverable transfer warning has occured.
      • getTransferMetrics

        public unlimited.core.transfers.UDPTransferMetricsContainer getTransferMetrics()
        Specified by:
        getTransferMetrics in interface unlimited.core.transfers.UDPTransferMetrics
      • addObserver

        @Deprecated
        public void addObserver​(java.util.Observer o)
        Deprecated.
        Java has Deprecated Observable due to it being an anti-pattern.
        Overrides:
        addObserver in class java.util.Observable
      • killAll

        public void killAll()