de.esprit.netsuite.client.activity.transfer

## Class IOFileTransferConnection<C extends ClientContext>

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.netsuite.client.AbstractClientObject<C>
      - - de.esprit.netsuite.client.activity.transfer.IOFileTransferConnection<C>

- All Implemented Interfaces:
    ApplicationObject<C>, CancellableTask, SimpleLogSupport, Dumpable, ClientObject<C>
  Direct Known Subclasses:
    FileDownloadConnection, FileUploadConnection

      public abstract class IOFileTransferConnection<C extends ClientContext>
      extends AbstractClientObject<C>
      implements CancellableTask, ClientObject<C>

  This class performs the transfer (upload or download) of a single file
  Author:
    Rainer Buesch

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `TRANSFER_BUFF_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IOFileTransferConnection(C clientCtx, FileTransferClientTask transferTask, FileTransferJob job, StreamWrapper streamWrapper)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancel()`
    `void` | `checkCancelled()`
    `void` | `close()` Closes all socket streams as well as the socket itself.
    `void` | `execute()`
    `protected void` | `fireReadProgress(long bytesDelta)`
    `java.io.File` | `getClientFile()`
    `protected java.lang.String` | `getClientFileInfo()`
    `long` | `getFileLength()`
    `java.io.InputStream` | `getReceiveStream()`
    `java.io.OutputStream` | `getSendStream()`
    `java.lang.String` | `getSocketInfo()`
    `FileTransferJob` | `getTransferJob()`
    `boolean` | `isTransferZipped()`
    `protected java.lang.Object` | `readObject()`
    `void` | `setFileLength(long fileLength)`
    `void` | `shutdownInput()`
    `void` | `shutdownOutput()`
    `java.lang.String` | `toString()` Returns a single line String that shows the values of the most important state variables of this object.
    `boolean` | `wasCancelled()` Tells whether ever an attempt has been made to cancel this task.
    `boolean` | `wasFoundZippedOnServer()`
    `protected java.lang.Object` | `writeAndReadObject(java.lang.Object sendObj)`
    `protected void` | `writeObject(java.lang.Object obj)`

    - ### Methods inherited from class de.esprit.netsuite.client.AbstractClientObject

      `getClientConfig, getClientContext`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString`

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

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

    - ### Methods inherited from interface de.esprit.netsuite.client.ClientObject

      `getClientContext`

- - ### Field Detail

    - #### TRANSFER_BUFF_SIZE

          public static final int TRANSFER_BUFF_SIZE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### IOFileTransferConnection

          public IOFileTransferConnection(C clientCtx,
                                  FileTransferClientTask transferTask,
                                  FileTransferJob job,
                                  StreamWrapper streamWrapper)
                                   throws java.lang.Exception

      Throws:
        `java.lang.Exception`

  - ### Method Detail

    - #### writeObject

          protected final void writeObject(java.lang.Object obj)
                                    throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### readObject

          protected final java.lang.Object readObject()
                                               throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### writeAndReadObject

          protected final java.lang.Object writeAndReadObject(java.lang.Object sendObj)
                                                       throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### fireReadProgress

          protected void fireReadProgress(long bytesDelta)

    - #### getClientFileInfo

          protected java.lang.String getClientFileInfo()

    - #### getSocketInfo

          public final java.lang.String getSocketInfo()

    - #### getSendStream

          public final java.io.OutputStream getSendStream()

    - #### getReceiveStream

          public final java.io.InputStream getReceiveStream()

    - #### shutdownInput

          public final void shutdownInput()
                                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### shutdownOutput

          public final void shutdownOutput()
                                    throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### close

          public final void close()

      Closes all socket streams as well as the socket itself.

    - #### isTransferZipped

          public final boolean isTransferZipped()

    - #### wasFoundZippedOnServer

          public final boolean wasFoundZippedOnServer()

    - #### getTransferJob

          public final FileTransferJob getTransferJob()

    - #### getClientFile

          public final java.io.File getClientFile()

    - #### getFileLength

          public final long getFileLength()

    - #### setFileLength

          public final void setFileLength(long fileLength)

    - #### execute

          public void execute()
                       throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### cancel

          public final void cancel()

    - #### checkCancelled

          public final void checkCancelled()

    - #### wasCancelled

          public final boolean wasCancelled()

      Description copied from interface: `CancellableTask`
      Tells whether ever an attempt has been made to cancel this task.
      Specified by:
        `wasCancelled` in interface `CancellableTask`

    - #### toString

          public java.lang.String toString()

      Description copied from interface: `Dumpable`
      Returns a single line String that shows the values of the most important state variables of this object. This is intentionally the same toString() method which is already provided by Object per se.
      Specified by:
        `toString` in interface `Dumpable`
      Overrides:
        `toString` in class `DumpableObject`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.