com.jscape.filetransfer

## Class FileTransferProgressEvent

- java.lang.Object
- - java.util.EventObject
  - - com.jscape.filetransfer.FileTransferEvent
    - - com.jscape.filetransfer.FileTransferProgressEvent

- All Implemented Interfaces:
    java.io.Serializable

      public class FileTransferProgressEvent
      extends FileTransferEvent

  Fired on significant progress in upload and download operations in `FileTransfer` derived classes.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DOWNLOAD`
    `static int` | `UPLOAD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileTransferProgressEvent(FileTransfer source, java.lang.String filename, java.lang.String absolutePath, int mode, long bytes, long totalBytes)` Constructs new `FileTransferProgressEvent`.
    `FileTransferProgressEvent(FileTransfer source, java.lang.String filename, java.lang.String absolutePath, int mode, long bytes, long readBytes, long totalBytes)` Constructor.
    `FileTransferProgressEvent(FileTransfer source, java.lang.String filename, java.lang.String absolutePath, java.lang.String localFilePath, int mode, long bytes, long readBytes, long totalBytes)` Creates a new event instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `accept(FileTransferListener listener)` Accepts event via FileTransferListener.
    `java.lang.String` | `getAbsolutePath()` Gets absolute path of file transferred.
    `long` | `getBytes()` Gets the number of bytes transferred so far.
    `java.lang.String` | `getFilename()` Gets name of file transferred.
    `java.lang.String` | `getLocalFilePath()` Get the local file path.
    `int` | `getMode()` Gets mode of transfer, upload or download.
    `long` | `getReadBytes()` Returns number of read bytes.
    `long` | `getTotalBytes()` Gets the number of bytes for the file being transferred.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.util.EventObject

      `getSource`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### UPLOAD

          public static final int UPLOAD

      See Also:
        Constant Field Values

    - #### DOWNLOAD

          public static final int DOWNLOAD

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FileTransferProgressEvent

          public FileTransferProgressEvent(FileTransfer source,
                                           java.lang.String filename,
                                           java.lang.String absolutePath,
                                           java.lang.String localFilePath,
                                           int mode,
                                           long bytes,
                                           long readBytes,
                                           long totalBytes)

      Creates a new event instance.
      Parameters:
        `source` -
        `filename` -
        `absolutePath` -
        `localFilePath` -
        `mode` -
        `bytes` -
        `readBytes` -
        `totalBytes` -

    - #### FileTransferProgressEvent

          public FileTransferProgressEvent(FileTransfer source,
                                           java.lang.String filename,
                                           java.lang.String absolutePath,
                                           int mode,
                                           long bytes,
                                           long totalBytes)

      Constructs new `FileTransferProgressEvent`.
      Parameters:
        `source` - the source of this event
        `filename` - the name of file being transferred
        `absolutePath` - the file path of file transferred
        `mode` - the direction of transfer
        `bytes` - the number of bytes transferred
        `totalBytes` - the number of bytes for the file being transferred

    - #### FileTransferProgressEvent

          public FileTransferProgressEvent(FileTransfer source,
                                           java.lang.String filename,
                                           java.lang.String absolutePath,
                                           int mode,
                                           long bytes,
                                           long readBytes,
                                           long totalBytes)

      Constructor.
      Parameters:
        `source` -
        `filename` -
        `absolutePath` -
        `mode` -
        `bytes` -
        `readBytes` -
        `totalBytes` -

  - ### Method Detail

    - #### getBytes

          public long getBytes()

      Gets the number of bytes transferred so far.
      Returns:
        bytes

    - #### getTotalBytes

          public long getTotalBytes()

      Gets the number of bytes for the file being transferred.
      Returns:
        bytes

    - #### getReadBytes

          public long getReadBytes()

      Returns number of read bytes.
      Returns:
        a number of read bytes

    - #### getFilename

          public java.lang.String getFilename()

      Gets name of file transferred.
      Returns:
        filename

    - #### getLocalFilePath

          public java.lang.String getLocalFilePath()

      Get the local file path.
      Returns:
        path

    - #### getAbsolutePath

          public java.lang.String getAbsolutePath()

      Gets absolute path of file transferred.
      Returns:
        the absolute path

    - #### getMode

          public int getMode()

      Gets mode of transfer, upload or download.
      Returns:
        mode
      See Also:
        `UPLOAD`, `DOWNLOAD`

    - #### accept

          public void accept(FileTransferListener listener)

      Accepts event via FileTransferListener.
      Specified by:
        `accept` in class `FileTransferEvent`
      Parameters:
        `listener` - the listener which receives event

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.util.EventObject`

Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved