Class AbstractTaskSftp

Direct Known Subclasses:
SftpCopyFromServer, SftpCopyToServer, SftpCreateDir, SftpDeleteFromServer, SftpMoveFromServer, SftpMoveToServer

public abstract class AbstractTaskSftp extends AbstractTaskRemote
Provides abstract sftp tasks.
  • Constructor Details

    • AbstractTaskSftp

      public AbstractTaskSftp()
  • Method Details

    • getConnectionProtocol

      public String getConnectionProtocol()
      Description copied from class: AbstractTask
      "SFTP"などのprotocolを設定。localの場合はnull。
      Specified by:
      getConnectionProtocol in class AbstractTask
    • doSpecificTask

      protected abstract void doSpecificTask(ConnectionToRemoteServer connection, HousekeepFilesTaskRecord taskRec, String fromPath, String toPath, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList) throws Exception
      Executes task.
      Throws:
      Exception
    • doTaskInternal

      protected void doTaskInternal(ConnectionToRemoteServer connection, HousekeepFilesTaskRecord taskRec, String fromPath, String toPath, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList)
      Description copied from class: AbstractTask
      doTaskから呼び出される。各taskにて処理実装。
      Specified by:
      doTaskInternal in class AbstractTask
    • getConnection

      public ConnectionToSftpServer getConnection(String remoteHost, Map<String,HousekeepFilesAuthRecord> authMap) throws Exception
      Description copied from class: AbstractTask
      それぞれのremote通信に対するconnection。
      Specified by:
      getConnection in class AbstractTask
      Throws:
      Exception
    • getRemoteFileInfo

      protected FileInfo getRemoteFileInfo(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path)
      Specified by:
      getRemoteFileInfo in class AbstractTask
    • getRemoteFileInfoList

      protected List<FileInfo> getRemoteFileInfoList(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path)
      Returns specified file or directory if exists.
      Specified by:
      getRemoteFileInfoList in class AbstractTask
    • getRemoteDirChildrenNameList

      public List<String> getRemoteDirChildrenNameList(com.jcraft.jsch.ChannelSftp channel, String dirPath) throws com.jcraft.jsch.SftpException
      フォルダはあるが配下のファイル/フォルダがないのと、フォルダがない、またはpathがファイルの場合を区別するため、後者はエラーとする。
      Throws:
      com.jcraft.jsch.SftpException
    • getRemoteDirChildrenList

      public List<com.jcraft.jsch.ChannelSftp.LsEntry> getRemoteDirChildrenList(com.jcraft.jsch.ChannelSftp channel, String dirPath) throws com.jcraft.jsch.SftpException
      フォルダはあるが配下のファイル/フォルダがないのと、フォルダがない、またはpathがファイルの場合を区別するため、後者はエラーとする。
      Throws:
      com.jcraft.jsch.SftpException
    • remoteDirExists

      public boolean remoteDirExists(com.jcraft.jsch.ChannelSftp channel, String path) throws com.jcraft.jsch.SftpException
      Throws:
      com.jcraft.jsch.SftpException
    • remoteFileExists

      public boolean remoteFileExists(com.jcraft.jsch.ChannelSftp channel, String path) throws com.jcraft.jsch.SftpException
      Throws:
      com.jcraft.jsch.SftpException
    • remoteExists

      public boolean remoteExists(com.jcraft.jsch.ChannelSftp channel, String path) throws com.jcraft.jsch.SftpException
      Throws:
      com.jcraft.jsch.SftpException
    • getRemoteDetail

      public com.jcraft.jsch.ChannelSftp.LsEntry getRemoteDetail(com.jcraft.jsch.ChannelSftp channel, String path) throws com.jcraft.jsch.SftpException
      指定したパスをLsEntry形式で返す。 ディレクトリの場合はgetFilenam()が"."となるので注意。
      Throws:
      com.jcraft.jsch.SftpException