Package com.sos.VirtualFileSystem.FTP

Source Code of com.sos.VirtualFileSystem.FTP.SOSFTPOptions

/********************************************************* begin of preamble
**
** Copyright (C) 2003-2010 Software- und Organisations-Service GmbH.
** All rights reserved.
**
** This file may be used under the terms of either the
**
**   GNU General Public License version 2.0 (GPL)
**
**   as published by the Free Software Foundation
**   http://www.gnu.org/licenses/gpl-2.0.txt and appearing in the file
**   LICENSE.GPL included in the packaging of this file.
**
** or the
** 
**   Agreement for Purchase and Licensing
**
**   as offered by Software- und Organisations-Service GmbH
**   in the respective terms of supply that ship with this file.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
** IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
** POSSIBILITY OF SUCH DAMAGE.
********************************************************** end of preamble*/
package com.sos.VirtualFileSystem.FTP;

import java.io.File;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import org.apache.log4j.Logger;

import sos.configuration.SOSConfiguration;
import sos.util.SOSStandardLogger;

import com.sos.JSHelper.Annotations.JSOptionDefinition;
import com.sos.JSHelper.Exceptions.JSExceptionMandatoryOptionMissing;
import com.sos.JSHelper.Exceptions.JobSchedulerException;
import com.sos.JSHelper.Listener.JSListener;
import com.sos.JSHelper.Options.SOSOptionArrayList;
import com.sos.JSHelper.Options.SOSOptionBoolean;
import com.sos.JSHelper.Options.SOSOptionElement;
import com.sos.JSHelper.Options.SOSOptionFolderName;
import com.sos.JSHelper.Options.SOSOptionHostName;
import com.sos.JSHelper.Options.SOSOptionInteger;
import com.sos.JSHelper.Options.SOSOptionJSTransferMethod;
import com.sos.JSHelper.Options.SOSOptionJSTransferMethod.enuJSTransferModes;
import com.sos.JSHelper.Options.SOSOptionString;
import com.sos.JSHelper.io.Files.JSFile;
import com.sos.VirtualFileSystem.Factory.VFSFactory.enuTransferTypes;
import com.sos.VirtualFileSystem.Options.SOSConnection2Options;
import com.sos.VirtualFileSystem.Options.SOSConnection2OptionsAlternate;
import com.sos.VirtualFileSystem.Options.SOSConnection2OptionsSuperClass;
import com.sos.i18n.annotation.I18NMessage;
import com.sos.i18n.annotation.I18NMessages;
import com.sos.i18n.annotation.I18NResourceBundle;

/**
* \class SOSFTPOptions
*
* \brief SOSFTPOptions -
*
* \details
*
* \code
*   .... code goes here ...
* \endcode
*
* <p style="text-align:center">
* <br />---------------------------------------------------------------------------
* <br /> APL/Software GmbH - Berlin
* <br />##### generated by ClaviusXPress (http://www.sos-berlin.com) #########
* <br />---------------------------------------------------------------------------
* </p>
* \author KB
* @version $Id: SOSFTPOptions.java 14789 2011-07-08 15:51:52Z sos $16.05.2010
* \see reference
*
* Created on 26.07.2010 20:52:28
*/
/**
* @author KB
*
*/
@I18NResourceBundle(baseName = "SOSVirtualFileSystem", defaultLocale = "en")
public class SOSFTPOptions extends SOSFtpOptionsSuperClass {

  @I18NMessages(value = { @I18NMessage("possible wrong variable-value specified in '%1$s' of key '%2$s'. not substituted."), //
      @I18NMessage(value = "possible wrong variable-value specified in '%1$s' of key '%2$s'. not substituted.", locale = "en_UK", //
      explanation = "possible wrong variable-value specified in '%1$s' of key '%2$s'. not substituted." //
      ), //
      @I18NMessage(value = "eine nicht erkannte Variable '%1$s' (im Schl�ssel '%2$s') wurde nicht ersetzt.", locale = "de", //
      explanation = "possible wrong variable-value specified in '%1$s' of key '%2$s'. not substituted." //
      ) //
  }, msgnum = "SOSVfs-W-0070", msgurl = "SOSVfs-W-0070")
/*!
* \var SOSVfs_W_0070
* \brief possible wrong variable-value specified in '%1$s' of key '%2$s'. not substituted.
*/
  public static final String  SOSVfs_W_0070        = "SOSVfs_W_0070";

  @I18NMessages(value = { @I18NMessage("Profile/Section '%1$s' not found or is empty in file '%2$s'"), //
      @I18NMessage(value = "Profile '%1$s' not found or is empty in file '%2$s'", locale = "en_UK", //
      explanation = "Profile '%1$s' not found or is empty in file '%2$s'" //
      ), //
      @I18NMessage(value = "Profile bzw. Sektion '%1$s' wurde nicht gefunden oder hat keine Eintr�ge. INI-Datei ist '%2$s'", locale = "de", //
      explanation = "Profile '%1$s' not found or is empty in file '%2$s'" //
      ) //
  }, msgnum = "SOSVfs-E-0060", msgurl = "SOSVfs-E-0060")
/*!
* \var SOSVfs-E-0060
* \brief Profile '%1$s' not found or is empty in file '%2$s'
*/
  public static final String  SOSVfs_E_0060        = "SOSVfs-E-0060";

  @I18NMessages(value = { @I18NMessage("usage of option '%1$s' is in conflict with option(s) '%2$s'."), //
      @I18NMessage(value = "usage of option '%1$s' is in conflict with option(s) '%2$s'.", locale = "en_UK", //
      explanation = "usage of option '%1$s' is in conflict with option(s) '%2$s'." //
      ), //
      @I18NMessage(value = "Die Verwendung der Option '%1$s' ist zusammen mit den Option(en) '%2$s' nicht m�glich.", locale = "de", //
      explanation = "usage of option '%1$s' is in conflict with option(s) '%2$s'." //
      ) //
  }, msgnum = "SOSVfs-E-0050", msgurl = "SOSVfs-E-0050")
  /*!
   * \var SOSVfs-E-0050
   * \brief usage of option '%1$s' is in conflict with option(s) '%2$s'.
   */
  public static final String  SOSVfs_E_0050        = "SOSVfs-E-0050";

  @I18NMessages(value = {
      @I18NMessage("option(s) '%1$s' not supported by the requested protocol '%2$s'."), //
      @I18NMessage(value = "option(s) '%1$s' not supported by the requested protocol '%2$s'.", locale = "en_UK", //
      explanation = "option(s) '%1$s' not supported by the requested protocol" //
      ), //
      @I18NMessage(value = "Die Option(en) '%1$s' sind mit dem spezifizierten Protokoll '%2$s' nicht m�glich bzw. werden nicht unterst�tzt.", locale = "de", //
      explanation = "option(s) '%1$s' not supported by the requested protocol" //
      ) //
  }, msgnum = "SOSVfs-E-0040", msgurl = "msgurl")
/*!
* \var SOSDE_E_0040
* \brief option(s) '%1$s' not supported by the requested protocol
*/
  public static final String  SOSVfs_E_0040        = "SOSVfs_E_0040";

  @I18NMessages(value = {
      @I18NMessage("unsupported parameter settings '%1$s': only one of this parameters can be used at the same time."), //
      @I18NMessage(value = "unsupported parameter settings '%1$s': only one of this parameters can be used at the same time.", locale = "en_UK", //
      explanation = "unsupported parameter settings '%1$s': only one of this parameters can be used at the same time." //
      ), //
      @I18NMessage(value = "Parameter Konflikt bei Optionen '%1$s': die Verwendung eines Parameters schliesst die Verwendung der anderen Parameter aus.", locale = "de", //
      explanation = "unsupported parameter settings '%1$s': only one of this parameters can be used at the same time." //
      ) //
  }, msgnum = "SOSVfs-E-0030", msgurl = "msgurl")
/*!
* \var SOSVfs_E_0030
* \brief unsupported parameter settings '%1$s': only one of this parameters can be used at the same time.
*/
  public static final String  SOSVfs_E_0030        = "SOSVfs_E_0030";

  @I18NMessages(value = { @I18NMessage("Section with name '%1$s' for include not found or is empty in file '%2$s'"), //
      @I18NMessage(value = "Include '%1$s' not found or is empty in file '%2$s'", locale = "en_UK", //
      explanation = "Include '%1$s' not found or is empty in file '%2$s'" //
      ), //
      @I18NMessage(value = "Profile/Sektion f�r Include '%1$s' wurde nicht gefunden oder ist leer in der Datei '%2$s'", locale = "de", //
      explanation = "In einer Include-Directive wurde ein Verweis auf eine Abschnitt (Section) verwendet, der in der INI-Datei nicht gefunden wurde." //
      ) //
  }, msgnum = "SOSVfs-E-0000", msgurl = "msgurl")
  /*!
   * \var SOSVfs_E_0000
   * \brief Include '%1$s' not found or is empty in file '%2$s'
   */
  public static final String  SOSVfs_E_0000        = "SOSVfs-E-0000";

  @I18NMessages(value = { @I18NMessage("local directory does not exist or is not accessible: '%1$s'."), //
      @I18NMessage(value = "local directory does not exist or is not accessible: '%1$s'.", locale = "en_UK", //
      explanation = "local directory does not exist or is not accessible: '%1$s'." //
      ), //
      @I18NMessage(value = "Das lokale Verzeichnis '%1$s' existiert nicht oder es fehlen die Zugriffsrechte.", locale = "de", //
      explanation = "local directory does not exist or is not accessible: '%1$s'." //
      ) //
  }, msgnum = "SOSVfs-E-0010", msgurl = "msgurl")
  /*!
   * \var SOSVfs_E_0010
   * \brief local directory does not exist or is not accessible: '%1$s'.
   */
  public static final String  SOSVfs_E_0010        = "SOSVfs-E-0010";

  @I18NMessages(value = { @I18NMessage("usage of parameter '%1$s' requires one or more additional parameters, which are missing: '%2$s'."), //
      @I18NMessage(value = "usage of parameter '%1$s' requires one or more additional parameters, which are missing: '%2$s'.", locale = "en_UK", //
      explanation = "parameter is missing for specified parameter [replacing]: [replacement]" //
      ), //
      @I18NMessage(value = "Die Verwendung des Parameters '%1$s' erfordert weitere Parameter ('%2$s'), die aber nicht angegeben wurden. ", locale = "de", //
      explanation = "parameter is missing for specified parameter [replacing]: [replacement]" //
      ) //
  }, msgnum = "SOSVfs-E-0020", msgurl = "msgurl")
/*!
* \var SOSVfs_E_0020
* \brief parameter is missing for specified parameter [replacing]: [replacement]
*/
  public static final String  SOSVfs_E_0020        = "SOSVfs-E-0020";
  public static final String  conParametersMissing    = SOSVfs_E_0020;

  /**
     *
     */
  private static final long  serialVersionUID      = -8219289268940238015L;
  private final String    conClassName        = "SOSFTPOptions";
  private Logger        logger            = Logger.getLogger(SOSFTPOptions.class);
  private Properties      propSOSFtpEnvironmentVars  = null;
  private Properties      schedulerParams        = null;
  private boolean        zeroByteFiles        = false;
  private boolean        zeroByteFilesStrict      = false;
  private boolean        zeroByteFilesRelaxed    = false;
  private boolean        flgCheckMandatoryDone    = false;

  private boolean        flgReadSettingsFileIsActive  = false;
  // Map<String, String> variables = null;
  private Properties      propAllEnvironmentVariables  = null;

  /**
   * \option CheckServerFeatures
   * \type SOSOptionBoolean
   * \brief CheckServerFeatures - get the provided features of a ftp-server
   *
   * \details
   * The available features of a ftp-server
   *
   * \mandatory: false
   *
   * \created 27.06.2011 12:02:51 by KB
   */
  @JSOptionDefinition(name = "CheckServerFeatures", description = "The available features of a ftp-server", key = "CheckServerFeatures", type = "SOSOptionBoolean", mandatory = false)
  public SOSOptionBoolean    CheckServerFeatures      = new SOSOptionBoolean( // ...
                                  this, // ....
                                  conClassName + ".CheckServerFeatures", // ...
                                  "The available features of a ftp-server", // ...
                                  "false", // ...
                                  "false", // ...
                                  false);

  public String getCheckServerFeatures() {

    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::getCheckServerFeatures";

    return CheckServerFeatures.Value();
  } // public String getCheckServerFeatures

  public SOSFTPOptions setCheckServerFeatures(final String pstrValue) {

    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setCheckServerFeatures";
    CheckServerFeatures.Value(pstrValue);
    return this;
  } // public SOSFTPOptions setCheckServerFeatures

  /**
   * \option PollKeepConnection
   * \type SOSOptionBoolean
   * \brief PollKeepConnection - Keep connection during polling
   *
   * \details
   * With this parameter it is possible to close the connection to the server
   * after an unsucsesfull polling cycle.
   * The connection will be established before the next cycle will start.
   *
   * \mandatory: false
   *
   * \created 20.06.2011 11:53:23 by KB
   */
  @JSOptionDefinition(name = "PollKeepConnection", description = "Keep connection while polling", key = "PollKeepConnection", type = "SOSOptionBoolean", mandatory = true)
  public SOSOptionBoolean  PollKeepConnection  = new SOSOptionBoolean( // ...
                            this, // ....
                            conClassName + ".PollKeepConnection", // ...
                            "Keep connection while polling", // ...
                            "false", // ...
                            "false", // ...
                            true);

  public String getPollKeepConnection() {

    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::getPollKeepConnection";

    return PollKeepConnection.Value();
  } // public String getPollKeepConnection

  public SOSFTPOptions setPollKeepConnection(final String pstrValue) {

    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setPollKeepConnection";
    PollKeepConnection.Value(pstrValue);
    return this;
  } // public SOSFTPOptions setPollKeepConnection

  /**
   * \option FileNameEncoding
   * \type SOSOptionString
   * \brief FileNameEncoding - Set the encoding-type of a file name
   *
   * \details
   * Set the encoding-type of a file name
   *
   * \mandatory: false
   *
   * \created 27.06.2011 12:20:47 by KB
   */
  @JSOptionDefinition(name = "FileNameEncoding", description = "Set the encoding-type of a file name", key = "FileNameEncoding", type = "SOSOptionString", mandatory = false)
  public SOSOptionString  FileNameEncoding  = new SOSOptionString( // ...
                            this, // ....
                            conClassName + ".FileNameEncoding", // ...
                            "Set the encoding-type of a file name", // ...
                            "", // ...
                            "ISO-8859-1", // ...
                            false);

  public String getFileNameEncoding() {

    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::getFileNameEncoding";

    return FileNameEncoding.Value();
  } // public String getFileNameEncoding

  public SOSFTPOptions setFileNameEncoding(final String pstrValue) {

    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setFileNameEncoding";
    FileNameEncoding.Value(pstrValue);
    return this;
  } // public SOSFTPOptions setFileNameEncoding

  /**
   * \option ControlEncoding
   * \type SOSOptionString
   * \brief ControlEncoding - Specify the encoding-type used by the server
   *
   * \details
   * Specify the encoding-type, e.g. utf-8 or iso-8859-1, used by the server
   *
   * \mandatory: false
   *
   * \created 20.05.2011 12:05:40 by KB
   */

  @JSOptionDefinition(name = "ControlEncoding", description = "Specify the encoding-type, e.g. utf-8, used by the server", key = "ControlEncoding", type = "SOSOptionString", mandatory = false)
  public SOSOptionString  ControlEncoding  = new SOSOptionString( // ...
                          this, // ....
                          conClassName + ".ControlEncoding", // ...
                          "Specify the encoding-type, e.g. utf-8, used by the server", // ...
                          "", // ...
                          "", // ...
                          false);

  public String getControlEncoding() {

    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::getControlEncoding";

    return ControlEncoding.Value();
  } // public String getControl_Encoding

  public SOSFTPOptions setControlEncoding(final String pstrValue) {

    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setControlEncoding";
    ControlEncoding.Value(pstrValue);
    return this;
  } // public SOSFTPOptions setControl_Encoding

  /**
   * \option HistoryEntries
   * \type SOSOptionArrayList
   * \brief HistoryEntries - List of additional entries for the transfer history
   * 
   * \details
   * List of additional entries for the transfer history.
   *
   * \mandatory: false
   *
   * \created 26.04.2011 21:21:45 by KB
   */
  @JSOptionDefinition(name = "HistoryEntries", description = "List of additional entries for the transfer history.", key = "HistoryEntries", type = "SOSOptionArrayList", mandatory = false)
  public SOSOptionArrayList  HistoryEntries  = new SOSOptionArrayList( // ...
                            this, // ....
                            conClassName + ".HistoryEntries", // ...
                            "List of additional entries for the transfer history.", // ...
                            "", // ...
                            "", // ...
                            false);

  public String getHistoryEntries() {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::getHistoryEntries";
    return HistoryEntries.Value();
  } // public String getHistoryEntries

  public SOSFTPOptions setHistoryEntries(final String pstrValue) {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setHistoryEntries";
    HistoryEntries.Value(pstrValue);
    return this;
  } // public SOSFTPOptions setHistoryEntries
  /**
   * \option SendTransferHistory
   * \type SOSOptionBoolean
   * \brief SendTransferHistory - Send transfer history to background service
   *
   * \details
   * If this option is set to true, the the transfer history will be sent to the background service.
   *
   * \mandatory: false
   *
   * \created 26.04.2011 20:19:42 by KB
   */
  @JSOptionDefinition(name = "SendTransferHistory", description = "If this option is set to true, the transfer history will be sent to the background service.", key = "SendTransferHistory", type = "SOSOptionBoolean", mandatory = true)
  public SOSOptionBoolean  SendTransferHistory  = new SOSOptionBoolean( // ...
                            this, // ....
                            conClassName + ".SendTransferHistory", // ...
                            "If this option is set to true, the transfer history will be sent to the background service.", // ...
                            "false", // ...
                            "true", // ...
                            false);

  public String getSendTransferHistory() {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::getSendTransferHistory";
    return SendTransferHistory.Value();
  } // public String getSendTransferHistory

  public SOSFTPOptions setSendTransferHistory(final String pstrValue) {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setSendTransferHistory";
    SendTransferHistory.Value(pstrValue);
    return this;
  } // public SchedulerObjectFactoryOptions setSendTransferHistory
  /**
   * \option Scheduler_Transfer_Method
   * \type SOSOptionJSTransferMethod
   * \brief Scheduler_Transfer_Method - How to communicate with the JobScheduler
   *
   * \details
   * The technical method of how to communicate with the JobScheduler
   *
   * \mandatory: true
   *
   * \created 26.04.2011 12:22:06 by KB
   */
  @JSOptionDefinition(name = "Scheduler_Transfer_Method", description = "The technical method of how to communicate with the JobScheduler", key = "Scheduler_Transfer_Method", type = "SOSOptionJSTransferMethod", mandatory = true)
  public SOSOptionJSTransferMethod  Scheduler_Transfer_Method  = new SOSOptionJSTransferMethod( // ...
                                      this, // ....
                                      conClassName + ".Scheduler_Transfer_Method", // ...
                                      "The technical method of how to communicate with the JobScheduler", // ...
                                      enuJSTransferModes.udp.description, // ...
                                      enuJSTransferModes.udp.description, // ...
                                      true);

  public String getScheduler_Transfer_Method() {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::getScheduler_Transfer_Method";
    return Scheduler_Transfer_Method.Value();
  } // public String getScheduler_Transfer_Method

  public SOSFTPOptions setScheduler_Transfer_Method(final String pstrValue) {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setScheduler_Transfer_Method";
    Scheduler_Transfer_Method.Value(pstrValue);
    return this;
  } // public SchedulerObjectFactoryOptions setScheduler_Transfer_Method
  /**
   * \option PreFtpCommands
   * \type SOSOptionString
   * \brief PreFtpCommands - FTP commands, which has to be executed before the transfer started
   *
   * \details
   * FTP commands, which has to be executed before the transfer started.
   *
   * see also: PostFtpCommands
   *
   * \mandatory: false
   *
   * \created 05.04.2011 15:45:52 by KB
   */
  @JSOptionDefinition(name = "PreFtpCommands", description = "FTP commands, which has to be executed before the transfer started.", key = "PreFtpCommands", type = "SOSOptionString", mandatory = false)
  public SOSOptionString  PreFtpCommands  = new SOSOptionString( // ...
                          this, // ....
                          conClassName + ".Pre_Ftp_Commands", // ...
                          "FTP commands, which has to be executed before the transfer started.", // ...
                          "", // ...
                          "", // ...
                          false);

  public String getPreFtpCommands() {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::getPreFtpCommands";
    return PreFtpCommands.Value();
  } // public String getPreFtpCommands

  public SOSFTPOptions setPreFtpCommands(final String pstrValue) {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setPreFtpCommands";
    PreFtpCommands.Value(pstrValue);
    return this;
  } // public SOSFTPOptions setPreFtpCommands
  public SOSOptionString    SecurityHashType    = new SOSOptionString(this, conClassName + ".security_hash_type", // HashMap-Key
                                "The Type of the security hash, e.g. MD5", // Titel
                                "MD5", // InitValue
                                "MD5", // DefaultValue
                                false // isMandatory
                            );
  public SOSOptionBoolean    DecompressAfterTransfer  = new SOSOptionBoolean(this, conClassName + ".Decompress_After_Transfer", // HashMap-Key
                                "Decompress zipped-files after transfer", // Titel
                                "false", // InitValue
                                "false", // DefaultValue
                                false // isMandatory
                            );
  public SOSOptionBoolean    ConcurrentTransfer    = new SOSOptionBoolean(this, conClassName + ".Concurrent_Transfer", // HashMap-Key
                                "Process transfers simultaneously", // Titel
                                "false", // InitValue
                                "false", // DefaultValue
                                false // isMandatory
                            );
  public SOSOptionBoolean    CheckSecurityHash    = new SOSOptionBoolean(this, conClassName + ".Check_Security_Hash", // HashMap-Key
                                "Decompress zipped-files after transfer", // Titel
                                "false", // InitValue
                                "false", // DefaultValue
                                false // isMandatory
                            );
  public SOSOptionInteger    MaxConcurrentTransfers  = new SOSOptionInteger(this, conClassName + ".Max_Concurrent_Transfers", // HashMap-Key
                                "Maximum Numbers of parallel transfers", // Titel
                                "5", // InitValue
                                "1", // DefaultValue
                                false // isMandatory
                            );
  public SOSOptionBoolean    CreateSecurityHashFile  = new SOSOptionBoolean(this, conClassName + ".create_security_hash_file", // HashMap-Key
                                "This parameter specifies whether the content of a", // Titel
                                "false", // InitValue
                                "false", // DefaultValue
                                false // isMandatory
                            );
  public SOSOptionBoolean    CreateSecurityHash    = new SOSOptionBoolean(this, conClassName + ".create_security_hash", // HashMap-Key
                                "This parameter specifies whether the content of a", // Titel
                                "true", // InitValue
                                "false", // DefaultValue
                                false // isMandatory
                            );
  public SOSOptionFolderName  SourceDir        = new SOSOptionFolderName(this, conClassName + ".source_dir", // HashMap-Key
                                "local_dir Local directory into which or from which", // Titel
                                "", // InitValue
                                "", // DefaultValue
                                false // isMandatory
                            );
  public SOSOptionFolderName  TargetDir        = new SOSOptionFolderName(this, conClassName + ".target_dir", // HashMap-Key
                                "target_dir directory into which or from which", // Titel
                                "", // InitValue
                                "", // DefaultValue
                                false // isMandatory
                            );
  public SOSOptionInteger    BufferSize        = new SOSOptionInteger(this, conClassName + ".buffer_Size", // HashMap-Key
                                "This parameter specifies the interval in seconds", // Titel
                                "32000", // InitValue
                                "4096", // DefaultValue
                                false // isMandatory
                            );

  public SOSFTPOptions() {
    //
  }
  private SOSConnection2Options  objConnectionOptions  = null;

  /**
   * \brief SOSFTPOptions
   *
   * \details
   *
   * @param pobjListener
   */
  public SOSFTPOptions(JSListener pobjListener) {
    super(pobjListener);
  }

  /**
   * \brief SOSFTPOptions
   *
   * \details
   *
   * @param JSSettings
   * @throws Exception
   */
  public SOSFTPOptions(HashMap<String, String> JSSettings) throws Exception {
    super(JSSettings);
    setChildClasses(JSSettings);
  }

  private void setChildClasses(HashMap<String, String> JSSettings) throws Exception {
    objConnectionOptions = new SOSConnection2Options(JSSettings);
  }

  /**
   *
   * \brief CheckMandatory
   * 
   * \details
   *
   * \return
   * @throws JSExceptionMandatoryOptionMissing, Exception
   *
   */
  @Override
  public void CheckMandatory() {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::CheckMandatory";
    if (this.flgCheckMandatoryDone == true) {
      return;
    }
    this.operation.CheckMandatory();
    String localDir = this.local_dir.Value();
    if (isEmpty(localDir) == true) {
      String strPathName = this.file_path.Value();
      if (isNotEmpty(strPathName) == true) {
        JSFile fleT = new JSFile(strPathName);
        // fn.substring(0, fn.lastIndexOf(java.io.File.pathSeparatorChar));
        String strParent = fleT.getParent();
        if (strParent != null && strParent.equalsIgnoreCase(strPathName) == false) {
          this.local_dir.Value(fleT.getParent());
        }
      }
    }
    localDir = this.local_dir.Value();
    if (isEmpty(localDir) == true) {
      this.local_dir.Value(this.SourceDir.Value());
      localDir = this.local_dir.Value();
    }
    super.CheckMandatory();
    // TODO in die Options-Klasse, falls nicht schon drin ist ....
    if (localDir.startsWith("\\\\")) {
      while (localDir.indexOf("\\") != -1) {
        localDir = localDir.replace('\\', '/');
      }
    }
    this.local_dir.Value(localDir);
    // TODO in die Options-Klasse, falls nicht schon drin ist ....
    if (localDir.startsWith("file://")) {
      if (new File(createURI(localDir)).exists() == false) {
        throw new JobSchedulerException(String.format(objMsg.getMsg(SOSVfs_E_0010), localDir));
      }
    }
    if (replacing.IsNotEmpty() && replacement.IsEmpty()) {
      throw new JobSchedulerException(String.format(objMsg.getMsg(SOSVfs_E_0020), replacing.getKey(), replacement.getKey()));
    }
    if (replacing.IsEmpty() && replacement.IsNotEmpty()) {
      // throw new JobSchedulerException("SOSVfs-E-0000: parameter is missing for specified parameter [replacement]: [replacing]");
      throw new JobSchedulerException(String.format(objMsg.getMsg(SOSVfs_E_0020), replacement.getKey(), replacing.getKey()));
    }
    if (this.append_files.value() == true) {
      String strAppendFilesKey = append_files.getKey();
      if (isAtomicTransfer()) {
        String strT = getOptionNamesAsString(new SOSOptionElement[] { atomic_prefix, atomic_suffix });
        throw new JobSchedulerException(String.format(objMsg.getMsg(SOSVfs_E_0050), strAppendFilesKey, strT));
      }
      if (this.compress_files.value() == true) {
        String strT = getOptionNamesAsString(new SOSOptionElement[] { compress_files });
        throw new JobSchedulerException(String.format(objMsg.getMsg(SOSVfs_E_0050), strAppendFilesKey, strT));
      }

      if (compress_files.value() == true) {
        String strT = getOptionNamesAsString(new SOSOptionElement[] { append_files, compress_files });
        throw new JobSchedulerException(String.format(objMsg.getMsg(SOSVfs_E_0030), strT));
      }

      // TODO this check must be done at the implementation layer of the protocol-class.
      if (this.protocol.equalsIgnoreCase("ftp")) {
        // oke
      }
      else {
        throw new JobSchedulerException(String.format(objMsg.getMsg(SOSVfs_E_0040), strAppendFilesKey, this.protocol.Value()));
      }
    }
    // String strProt = this.protocol.Value();
    // if (strProt.equalsIgnoreCase("ftp")) {
    // this.host.CheckMandatory();
    // this.user.CheckMandatory();
    // this.host.CheckMandatory();
    // this.password.CheckMandatory();
    // }
    // else {
    // if (strProt.equalsIgnoreCase("sftp")) {
    // this.host.CheckMandatory();
    // if (BufferSize.value() > 32000) {
    // BufferSize.value(32000);
    // }
    // if (this.ssh_auth_file.IsNotEmpty()) {
    // }
    // else {
    // // if (this.ssh_auth_method.isPublicKey())
    // // throw new JobSchedulerException(
    // // "SOSVfs-E-0000: publickey specified, but no authentication filename was specified as parameter 'ssh_auth_file'");
    // }
    // }
    // }
    if (this.file_path.IsNotEmpty()) {
      if (this.file_spec.IsNotEmpty()) {
        this.file_path.Value("");
        // throw new
        // JobSchedulerException(String.format("SOSVfs-E-0000: 'file_path=%1$s' and 'file_spec=%2$s' specified, but only one of them is allowed",file_path.Value(),
        // file_spec.Value()));
        String strT = getOptionNamesAsString(new SOSOptionElement[] { file_path, file_spec });
        throw new JobSchedulerException(String.format(objMsg.getMsg(SOSVfs_E_0030), strT));
      }
      if (this.RecurseSubFolders.value() == true) {
        String strT = getOptionNamesAsString(new SOSOptionElement[] { file_path, recursive });
        throw new JobSchedulerException(String.format(objMsg.getMsg(SOSVfs_E_0030), strT));
      }
    }
    if (this.local_dir.IsEmpty() && this.file_spec.IsNotEmpty()) {
      throw new JobSchedulerException(String.format(objMsg.getMsg(conParametersMissing), file_spec.getKey(), local_dir.getKey()));
    }

    if (this.zero_byte_transfer.String2Bool() == true) {
      TransferZeroByteFiles(true);
      setZeroByteFilesStrict(false);
    }
    else {
      if (this.zero_byte_transfer.equalsIgnoreCase("strict")) {
        TransferZeroByteFiles(false);
        setZeroByteFilesStrict(true);
      }
      else {
        if (this.zero_byte_transfer.equalsIgnoreCase("relaxed")) {
          TransferZeroByteFiles(false);
          setZeroByteFilesStrict(false);
          setZeroByteFilesRelaxed(true);
        }
        else {
          TransferZeroByteFiles(false);
          setZeroByteFilesStrict(false);
        }
      }
    }
    getDataSourceType();
    getDataTargetType();
    if (this.CheckNotProcessedOptions.value() == true) {
      this.CheckNotProcessedOptions();
    }
    flgCheckMandatoryDone = true;
  } // private void CheckMandatory

  private String getOptionNamesAsString(SOSOptionElement[] objA) {

    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::getOptionNamesAsString";
    String strRet = "";
    for (SOSOptionElement sosOptionElement : objA) {
      if (strRet.length() > 0) {
        strRet += ", ";
      }
      strRet += sosOptionElement.getKey() + "=" + sosOptionElement.Value();
    }

    return strRet;
  } // private String getOptionNamesAsString

  /**
   *
   * \brief isAtomicTransfer
   *
   * \details
   *
   * \return boolean
   *
   * @return
   */
  public boolean isAtomicTransfer() {
    boolean flgIsAtomicTransfer = atomic_prefix.IsNotEmpty() || atomic_suffix.IsNotEmpty();
    return flgIsAtomicTransfer;
  }

  /**
   *
   * \brief getEnvVars
   *
   * \details
   *
   * \return Properties
   *
   * @return
   * @throws Exception
   */
  private Properties getEnvVars() throws Exception {
    // TODO raus hier. die Routine ist zu generell und mu� in die Shell-Klasse
    try {
      propSOSFtpEnvironmentVars = new Properties();
      // TODO SchedulerParams hat hier nichts zu suchen. Die m�ssen "von oben" �ber den JS-Adapter in die Klassen gereicht werden
      schedulerParams = new Properties();
      // TODO this *must* be a static global constant
      String conSchedulerEnvVarPrefix = "scheduler_param_";
      // TODO �ber einen Parameter vorgeben lassen
      String conSOSFtpEnvVarPrefix = "sosftp_";
      int intSOSFtpEnvVarPrefixLen = conSOSFtpEnvVarPrefix.length();
      Map<String, String> objM = System.getenv();
      propAllEnvironmentVariables = new Properties();
      propAllEnvironmentVariables.putAll(objM);
      for (Object k : propAllEnvironmentVariables.keySet()) {
        String key = (String) k;
        String value = (String) propAllEnvironmentVariables.get(k);
        //        logger.debug("getEnvVars() - " + key + "=" + value); //$NON-NLS-1$ //$NON-NLS-2$
        if (key.startsWith(conSOSFtpEnvVarPrefix)) {
          key = key.substring(intSOSFtpEnvVarPrefixLen);
          propSOSFtpEnvironmentVars.setProperty(key, value);
          continue;
        }
        if (key.startsWith("current_pid") || key.startsWith("ppid")) {
          propSOSFtpEnvironmentVars.setProperty(key, value);
          continue;
        }
        // TODO obsolet. must come from the JSAdapter as a Property-Collection
        if (key.indexOf(conSchedulerEnvVarPrefix) > -1) {
          schedulerParams.setProperty(key.substring(conSchedulerEnvVarPrefix.length()), value);
          continue;
        }
      }
      return propSOSFtpEnvironmentVars;
    }
    catch (Exception e) {
      String strM = "error occurred reading environment: " + e.toString();
      e.printStackTrace();
      logger.error(strM, e);
      throw new JobSchedulerException(strM);
    }
  }

  /**
   * \brief CommandLineArgs
   *
   * \details
   *
   * \return
   *
   * @param pstrArgs
   * @throws Exception
   */
  @Override
  public void CommandLineArgs(String[] pstrArgs) throws Exception {
    super.CommandLineArgs(pstrArgs);
    this.setAllOptions(super.objSettings);
  }

  /**
   * \brief setAllOptions
   *
   * \details
   *
   * \return
   *
   * @param pobjJSSettings
   * @throws Exception
   */
  public void setAllOptions(HashMap<String, String> pobjJSSettings) throws Exception {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setAllOptions";
    flgSetAllOptions = true;
    objSettings = pobjJSSettings;
    super.Settings(objSettings);
    super.setAllOptions(pobjJSSettings);
    flgSetAllOptions = false;
    if (flgReadSettingsFileIsActive == false) {
      if (settings.IsNotEmpty()) {
        flgReadSettingsFileIsActive = true;
        ReadSettingsFile();
        flgReadSettingsFileIsActive = false;
      }
    }
  } // public void setAllOptions (HashMap <String, String> JSSettings)

  /**
   *
   * \brief ReadSettingsFile
   *
   * \details
   * The Name of the Settings-File and the Name of the Profile (Section) has to be defined by the Options
   * "settings" and "profile" before entering this method.
   * \return void
   *
   */
  // TODO move 'ReadSettingsFile' to JSOptionClass
  public void ReadSettingsFile() {
    // TODO use the virtual file-system to allow access to diffent types of setting-stores
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::ReadSettingsFile";
    this.settings.CheckMandatory();
    this.profile.CheckMandatory();
    try {
      SOSStandardLogger objSOSLogger = new SOSStandardLogger(0);
      getEnvVars();// TODO replace SOSConfigurations by a "ini-File-only" approach, to avoid dependencies on job-scheduler
      SOSConfiguration objConf = new SOSConfiguration(settings.Value(), "globals", objSOSLogger);
      // SOSConfiguration objConf = new SOSConfiguration(settings.Value(), "globals", null);
      Properties objGlobals = objConf.getParameterAsProperties();
      objConf = new SOSConfiguration(settings.Value(), profile.Value(), objSOSLogger);
      // objConf = new SOSConfiguration(settings.Value(), profile.Value(), null);
      if (objConf.getParameterAsProperties().size() <= 0) {
        String strM = String.format(objMsg.getMsg(SOSVfs_E_0060), profile.Value(), settings.Value());
        // String strM = String.format("SOSVfs-E-0000: Profile '%1$s' not found or is empty in file '%2$s'", profile.Value(),
        // settings.Value());
        logger.error(strM, new JobSchedulerException(strM));
        throw new JobSchedulerException(strM);
      }
      Properties objP = new Properties();
      objP.putAll(objGlobals);
      objP.putAll(objConf.getParameterAsProperties());
      while (true) {
        Properties objIncludes = new Properties();
        boolean flgIncludeFound = false;
        for (Object k : objP.keySet()) {
          String strKey = (String) k;
          String strValue = (String) objP.get(k);
          logger.debug("ReadSettingsFile() - Property. Key = " + strKey + ", val = " + strValue); //$NON-NLS-1$ //$NON-NLS-2$
          if (isIncludeDirective(strKey)) {
            String[] strValues = strValue.split(",");
            for (String strV : strValues) {
              SOSConfiguration config_ = new SOSConfiguration(settings.Value(), strV, objSOSLogger);
              if (config_.getParameterAsProperties().size() <= 0) {

                // String strM = String.format("SOSVfs-E-0000: Include '%1$s' not found or is empty in file '%2$s'", strV,
                // settings.Value());
                String strM = String.format(objMsg.getMsg(SOSVfs_E_0000), strV, settings.Value());
                logger.error(strM);
                throw new JobSchedulerException(strM);
              }
              objIncludes.putAll(config_.getParameterAsProperties());
            }
            flgIncludeFound = true;
          }
          else {
            if (isIniComment(strKey) == false) {
              // TODO check duplicate Entry but take into account, that includes are in effect
              objIncludes.put(strKey, strValue);
            }
          }
        } // for
        if (objIncludes.size() > 0 && flgIncludeFound == true) {
          objP = new Properties();
          objP.putAll(objIncludes);
        }
        else {
          break;
        }
      }
      HashMap<String, String> map = new HashMap<String, String>();
      for (Object k : objP.keySet()) {
        String strKey = (String) k;
        String strValue = (String) objP.get(k);
        if (hasVariableToSubstiture(strValue) == true) {
          logger.debug("ReadSettingsFile() - Key = " + strKey + ", value = " + strValue); //$NON-NLS-1$ //$NON-NLS-2$
          strValue = SubstituteVariables(strValue, objP, "${", "}");
          strValue = SubstituteVariables(strValue, objP, "%{", "}");
          strValue = SubstituteVariables(strValue, objP, "%", "%");
          strValue = SubstituteVariables(strValue, propSOSFtpEnvironmentVars, "${", "}");
          strValue = SubstituteVariables(strValue, propSOSFtpEnvironmentVars, "%{", "}");
          strValue = SubstituteVariables(strValue, propSOSFtpEnvironmentVars, "%", "%");
          strValue = SubstituteVariables(strValue, propAllEnvironmentVariables, "${", "}");
          strValue = SubstituteVariables(strValue, propAllEnvironmentVariables, "%{", "}");
          strValue = SubstituteVariables(strValue, propAllEnvironmentVariables, "%", "%");
          // TODO wrong place: has to come from the JS-Adapter as properties
          strValue = SubstituteVariables(strValue, schedulerParams, "${", "}");
          strValue = SubstituteVariables(strValue, schedulerParams, "%{", "}");
          strValue = SubstituteVariables(strValue, schedulerParams, "%", "%");
          if (hasVariableToSubstiture(strValue)) {
            String strM = String.format(objMsg.getMsg(SOSVfs_W_0070), strValue, strKey);

            logger.warn(strM);
          }
        }
        map.put(strKey, strValue);
      }
      this.setAllOptions(map);
      setChildClasses(map);
    }
    catch (Exception e) {
      e.printStackTrace();
      logger.error("ReadSettingsFile()", e); //$NON-NLS-1$
      throw new JobSchedulerException(e.getMessage(), e);
    }
  } // private void ReadSettingsFile

  private boolean hasVariableToSubstiture(final String pstrValue) {
    boolean flgResult = false;
    if (pstrValue.indexOf("${") != -1 || pstrValue.indexOf("%{") != -1) {
      flgResult = true;
    }
    return flgResult;
  }

  private boolean isIniComment(final String pstrText) {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::isIniComment";
    return (pstrText.trim().startsWith(";"));
  } // private boolean isIniComment

  private boolean isIncludeDirective(final String pstrText) {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::isIniComment";
    return (pstrText.toLowerCase().startsWith("include"));
  } // private boolean isIniComment

  public String SubstituteVariables(String txt, Properties prop, String startPrefix, String endPrefix) {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::SubstituteVariables";
    try {
      for (Object k : prop.keySet()) {
        String key = (String) k;
        String strValue = (String) prop.get(key);
        String strSearchFor = startPrefix + key + endPrefix;
        // logger.debug(String.format("search for  '%1$s' with value '%2$s'", strSearchFor, strValue));
        int pos1 = -1;
        int pos2 = 0;
        while (true) {
          pos1 = txt.indexOf(strSearchFor, pos2);
          if (pos1 == -1) {
            break;
          }
          logger.debug(String.format("found '%1$s'", strSearchFor));
          int intEscaped = txt.indexOf("\\" + strSearchFor);
          if (intEscaped > -1 && intEscaped == pos1 - 1)
            pos1 = -1;
          pos2 = pos1 + strSearchFor.length();
          if (pos1 > -1 && pos2 > pos1) {
            txt = txt.substring(0, pos1) + strValue + txt.substring(pos2);
            logger.debug(String.format("new Text = '%1$s'", txt));
          }
        } // while
      } // for
      return txt;
    }
    catch (Exception e) {
      throw new JobSchedulerException("can not substitute parameters in: " + txt, e);
    }
  }

  // TODO in die Klasse JSFile implementieren
  protected URI createURI(String fileName) {
    URI uri = null;
    try {
      uri = new URI(fileName);
    }
    catch (Exception e) {
      try {
        File f = new File(fileName);
        String path = f.getCanonicalPath();
        if (fileName.startsWith("/")) {
          path = fileName;
        }
        String fs = System.getProperty("file.separator");
        if (fs.length() == 1) {
          char sep = fs.charAt(0);
          if (sep != '/')
            path = path.replace(sep, '/');
          if (path.charAt(0) != '/')
            path = '/' + path;
        }
        if (!path.startsWith("file://")) {
          path = "file://" + path;
        }
        uri = new URI(path);
      }
      catch (Exception ex) {
        throw (new JobSchedulerException("SOSVfs-E-0000: error in createURI(): " + e.getMessage()));
      }
    }
    return uri;
  }

  /**
   *
   * \brief OneOrMoreSingleFilesSpecified
   *
   * \details
   * Returns true, if one or more file-/path-names explicit specified
   * (instead of path or RegExp).
   *
   * \return boolean
   *
   * @return
   */
  public boolean OneOrMoreSingleFilesSpecified() {
    boolean flgisFilePath = this.file_path.IsNotEmpty();
    return flgisFilePath;
  }

  /**
   *
   * \brief getDataTargetType
   *
   * \details
   *
   * \return String
   *
   * @return
   */
  public String getDataTargetType() {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::getDataTargetType";
    String strDataTargetType = "";
    if (this.operation.Value().equalsIgnoreCase("send")) {
      strDataTargetType = this.protocol.Value();
      if (strDataTargetType.length() <= 0) {
        strDataTargetType = enuTransferTypes.local.Text();
        ;
      }
      this.SourceDir.Value(this.local_dir.Value());
      this.TargetDir.Value(this.remote_dir.Value());
      SOSConnection2OptionsAlternate objT = this.getConnectionOptions().Target();
      objT.host.Value(this.host.Value());
      objT.port.value(this.port.value());
      objT.protocol.Value(this.protocol.Value());
      objT.passive_mode.Value(this.passive_mode.Value());
      SOSConnection2OptionsSuperClass objAlt = objT.Alternatives();
      objAlt.host.Value(this.alternative_host.Value());
      objAlt.port.value(this.alternative_port.value());
      objAlt.protocol.Value(this.protocol.Value());
      objT.passive_mode.Value(this.alternative_passive_mode.Value());
    }
    else {
      if (this.operation.Value().equalsIgnoreCase("receive")) {
        strDataTargetType = enuTransferTypes.local.Text(); // "local";
        this.SourceDir.Value(this.remote_dir.Value());
        this.TargetDir.Value(this.local_dir.Value());
      }
      else {
        strDataTargetType = this.getConnectionOptions().Target().protocol.Value();
        if (strDataTargetType.length() <= 0) {
          strDataTargetType = enuTransferTypes.local.Text();
          ;
        }
        this.SourceDir.Value(this.local_dir.Value());
        this.TargetDir.Value(this.remote_dir.Value());
      }
    }
    logger.debug(String.format("DataTargetType = %1$s", strDataTargetType));
    return strDataTargetType;
  } // private String getDataTargetType

  /**
   *
   * \brief getDataSourceType
   *
   * \details
   *
   * \return String
   *
   * @return
   */
  public String getDataSourceType() {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::getDataSourceType";
    String strDataSourceType = "";
    if (this.operation.Value().equalsIgnoreCase("send")) {
      strDataSourceType = enuTransferTypes.local.Text();
      ;
      changeDirValues();
      // if (this.getConnectionOptions().Source().protocol.IsNotEmpty()) {
      // strDataSourceType = this.getConnectionOptions().Source().protocol.Value();
      // }
      SOSConnection2OptionsAlternate objT = this.getConnectionOptions().Source();
      objT.host.Value(SOSOptionHostName.conLocalHostName);
      objT.port.value(0);
      objT.protocol.Value(strDataSourceType);
      objT = this.getConnectionOptions().Target();
      objT.host = this.host;
      objT.port = this.port;
      objT.protocol = this.protocol;
      objT.user = this.user;
      objT.password = this.password;
      objT.ssh_auth_file = this.ssh_auth_file;
      objT.ssh_auth_method = this.ssh_auth_method;
      objT.passive_mode = this.passive_mode;
      SOSConnection2OptionsSuperClass objAlt = objT.Alternatives();
      objAlt.host.Value(this.alternative_host.Value());
      objAlt.port.value(this.alternative_port.value());
      objAlt.protocol.Value(this.protocol.Value());
      objT.passive_mode.Value(this.alternative_passive_mode.Value());
    }
    else {
      if (this.operation.Value().equalsIgnoreCase("receive")) {
        strDataSourceType = this.protocol.Value();
        if (strDataSourceType.length() <= 0) {
          strDataSourceType = enuTransferTypes.local.Text();
          ;
        }
        changeDirValues4Receive();
        SOSConnection2OptionsAlternate objT = this.getConnectionOptions().Source();
        objT.host.Value(this.host.Value());
        objT.port.value(this.port.value());
        objT.protocol.Value(this.protocol.Value());
        objT.passive_mode.Value(this.passive_mode.Value());
        objT.user = this.user;
        objT.password = this.password;
        objT.ssh_auth_file = this.ssh_auth_file;
        objT.ssh_auth_method = this.ssh_auth_method;
        SOSConnection2OptionsSuperClass objAlt = objT.Alternatives();
        objAlt.host.Value(this.alternative_host.Value());
        objAlt.port.value(this.alternative_port.value());
        objAlt.protocol.Value(this.protocol.Value());
        objT.passive_mode.Value(this.alternative_passive_mode.Value());
      }
      else {
        strDataSourceType = this.getConnectionOptions().Source().protocol.Value();
        if (strDataSourceType.length() <= 0) {
          strDataSourceType = enuTransferTypes.local.Text();
          ;
        }
        changeDirValues();
      }
    }
    logger.debug(String.format("DataSourceType = %1$s", strDataSourceType));
    return strDataSourceType;
  } // private String getDataSourceType

  private void changeDirValues() {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::changeDirValues";
    if (this.SourceDir.IsEmpty() == true) {
      this.SourceDir.Value(this.local_dir.Value());
    }
    if (this.TargetDir.IsEmpty() == true) {
      this.TargetDir.Value(this.remote_dir.Value());
    }
  } // private void changeDirValues

  private void changeDirValues4Receive() {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::changeDirValues";
    if (this.SourceDir.IsEmpty() == true) {
      this.SourceDir.Value(this.remote_dir.Value());
    }
    if (this.TargetDir.IsEmpty() == true) {
      this.TargetDir.Value(this.local_dir.Value());
    }
  } // private void changeDirValues

  /**
   *
   * \brief DoNotOverwrite
   *
   * \details
   *
   * \return boolean
   *
   * @return
   */
  public boolean DoNotOverwrite() {
    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::DoNotOverwrite";
    boolean flgT = this.overwrite_files.value() == false && this.append_files.value() == false;
    return flgT;
  } // private boolean DoNotOverwrite

  public void TransferZeroByteFiles(boolean pzeroByteFiles) {
    this.zeroByteFiles = pzeroByteFiles;
  }

  public boolean TransferZeroByteFiles() {
    return zeroByteFiles;
  }

  public void setZeroByteFilesStrict(boolean pzeroByteFilesStrict) {
    this.zeroByteFilesStrict = pzeroByteFilesStrict;
  }

  public boolean isZeroByteFilesStrict() {
    return zeroByteFilesStrict;
  }

  public void setZeroByteFilesRelaxed(boolean pzeroByteFilesRelaxed) {
    this.zeroByteFilesRelaxed = pzeroByteFilesRelaxed;
  }

  public boolean isZeroByteFilesRelaxed() {
    return zeroByteFilesRelaxed;
  }

  /**
   * \brief getconnectionOptions
   *
   * \details
   * getter
   *
   * @return the connectionOptions
   */
  public SOSConnection2Options getConnectionOptions() {
    if (objConnectionOptions == null) {
      objConnectionOptions = new SOSConnection2Options();
    }
    return objConnectionOptions;
  }

  /**
   * \brief setconnectionOptions -
   *
   * \details
   * setter
   *
   * @param connectionOptions the value for connectionOptions to set
   */
  public void setConnectionOptions(SOSConnection2Options connectionOptions) {
    objConnectionOptions = connectionOptions;
  }
}
TOP

Related Classes of com.sos.VirtualFileSystem.FTP.SOSFTPOptions

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.