de.esprit.netsuite.netdata.transfer

## Class AbstractTransferJob

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.common.util.TransferableObject
    - - de.esprit.netsuite.netdata.transfer.AbstractTransferJob

- All Implemented Interfaces:
    DeepCloneable, Dumpable, java.io.Serializable, java.lang.Cloneable
  Direct Known Subclasses:
    FileStreamJob, FileTransferJob

      public abstract class AbstractTransferJob
      extends TransferableObject

  This class describes a single file to be transferred between client and server.
  Author:
    Rainer Buesch
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractTransferJob(SessionId sessionId, JobConstraint constr, java.io.File serverBaseDir, java.lang.String serverFileName)`
    `protected` | `AbstractTransferJob(SessionId sessionId, JobConstraint constr, java.io.File clientBaseDir, java.lang.String clientFileName, java.io.File serverBaseDir, java.lang.String serverFileName)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkConsistency()` Must be called by subclasses as a last step.
    `protected abstract RemoteFileInfo` | `checkServerEntry(ServerContext serverCtx)`
    `protected java.io.File` | `findServerFile(java.io.File baseDir, java.lang.String serverFileName)`
    `java.io.File` | `getClientBaseDir()`
    `java.io.File` | `getClientFile()`
    `java.lang.String` | `getClientFileName()`
    `FileDataType` | `getFileDataType()`
    `JobId` | `getJobId()`
    `java.lang.String` | `getJobName()`
    `int` | `getPercentageDone()`
    `long` | `getRealFileSize()`
    `java.lang.String` | `getResourceName()` Used as resource name for server side locking purposes
    `java.io.File` | `getServerBaseDir()`
    `java.io.File` | `getServerFile()`
    `java.lang.String` | `getServerFileName()`
    `protected java.io.File` | `getServerRootDir(ServerContext serverCtx)` May be overridden for faking the servers rootDir.
    `SessionId` | `getSessionId()`
    `TransferDirection` | `getTransferDirection()`
    `protected boolean` | `isCreateTargetDir()`
    `boolean` | `isDownload()`
    `boolean` | `isKeepZippedOnServer()`
    `protected boolean` | `isSourceFileRequired()`
    `boolean` | `isTransferZipped()`
    `boolean` | `isUpload()`
    `boolean` | `isZippable()`
    `protected void` | `setClientFile(java.io.File clientFile)`
    `protected void` | `setCreateTargetDir(boolean isCreateTargetDir)`
    `void` | `setJobId(JobId jobId)`
    `void` | `setKeepZippedOnServer(boolean isKeepZipped)`
    `void` | `setPercentageDone(int percentageDone)`
    `void` | `setRealFileSize(long size)`
    `protected void` | `setServerFile(java.io.File serverFile)`
    `void` | `setServerRootSubPath(java.lang.String serverRootSubPath)` Allows for defining a sub-path below the servers workspaceDir.
    `void` | `setTransferZipped(boolean doZip)`
    `protected void` | `setWasFoundZippedOnServer(boolean wasFoundZippedOnServer)`
    `DumpString` | `toDumpString(DumpString s)` This method allows subclasses to add values to the existing DumpString of the superclass.
    `boolean` | `wasFoundZippedOnServer()`

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

      `clone, deepClone`

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

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

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

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

- - ### Constructor Detail

    - #### AbstractTransferJob

          protected AbstractTransferJob(SessionId sessionId,
                             JobConstraint constr,
                             java.io.File serverBaseDir,
                             java.lang.String serverFileName)

    - #### AbstractTransferJob

          protected AbstractTransferJob(SessionId sessionId,
                             JobConstraint constr,
                             java.io.File clientBaseDir,
                             java.lang.String clientFileName,
                             java.io.File serverBaseDir,
                             java.lang.String serverFileName)

  - ### Method Detail

    - #### isUpload

          public boolean isUpload()

    - #### isDownload

          public boolean isDownload()

    - #### getSessionId

          public SessionId getSessionId()

    - #### setServerRootSubPath

          public void setServerRootSubPath(java.lang.String serverRootSubPath)

      Allows for defining a sub-path below the servers workspaceDir. The workspaceDir appended by this sub-path is considered to be the root-directory for file storage. The default serverRootSubPath is `ServerDirectory.SRVDATA_DIR`.

    - #### getServerRootDir

          protected final java.io.File getServerRootDir(ServerContext serverCtx)

      May be overridden for faking the servers rootDir. There are cases, where the servers rootDir will need a sub-dir (i.e. rootDir/projectsDir).

    - #### setJobId

          public final void setJobId(JobId jobId)

    - #### getJobId

          public final JobId getJobId()

    - #### getJobName

          public final java.lang.String getJobName()

    - #### getClientBaseDir

          public final java.io.File getClientBaseDir()

    - #### getClientFileName

          public final java.lang.String getClientFileName()

    - #### getClientFile

          public final java.io.File getClientFile()

    - #### setClientFile

          protected final void setClientFile(java.io.File clientFile)

    - #### getServerBaseDir

          public final java.io.File getServerBaseDir()

    - #### getServerFileName

          public final java.lang.String getServerFileName()

    - #### getServerFile

          public final java.io.File getServerFile()

    - #### setServerFile

          protected final void setServerFile(java.io.File serverFile)

    - #### findServerFile

          protected final java.io.File findServerFile(java.io.File baseDir,
                                    java.lang.String serverFileName)

    - #### checkConsistency

          protected void checkConsistency()

      Must be called by subclasses as a last step.

    - #### getResourceName

          public final java.lang.String getResourceName()

      Used as resource name for server side locking purposes

    - #### isCreateTargetDir

          protected final boolean isCreateTargetDir()

    - #### setCreateTargetDir

          protected final void setCreateTargetDir(boolean isCreateTargetDir)

    - #### isSourceFileRequired

          protected final boolean isSourceFileRequired()

    - #### wasFoundZippedOnServer

          public final boolean wasFoundZippedOnServer()

    - #### setWasFoundZippedOnServer

          protected final void setWasFoundZippedOnServer(boolean wasFoundZippedOnServer)

    - #### getTransferDirection

          public final TransferDirection getTransferDirection()

    - #### setTransferZipped

          public final void setTransferZipped(boolean doZip)

    - #### getRealFileSize

          public final long getRealFileSize()

    - #### setRealFileSize

          public final void setRealFileSize(long size)

    - #### getPercentageDone

          public final int getPercentageDone()

    - #### setPercentageDone

          public final void setPercentageDone(int percentageDone)

    - #### getFileDataType

          public final FileDataType getFileDataType()

    - #### isKeepZippedOnServer

          public final boolean isKeepZippedOnServer()

    - #### setKeepZippedOnServer

          public final void setKeepZippedOnServer(boolean isKeepZipped)

    - #### isZippable

          public final boolean isZippable()

    - #### isTransferZipped

          public final boolean isTransferZipped()

    - #### checkServerEntry

          protected abstract RemoteFileInfo checkServerEntry(ServerContext serverCtx)
                                                      throws ServerException

      Throws:
        `ServerException`

    - #### toDumpString

          public DumpString toDumpString(DumpString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing DumpString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toDumpString` in interface `Dumpable`
      Overrides:
        `toDumpString` in class `DumpableObject`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.