Class AbstractTaskSftp
java.lang.Object
jp.ecuacion.tool.housekeepfiles.bl.task.AbstractTask
jp.ecuacion.tool.housekeepfiles.bl.task.AbstractTaskRemote
jp.ecuacion.tool.housekeepfiles.bl.task.AbstractTaskSftp
- Direct Known Subclasses:
SftpCopyFromServer,SftpCopyToServer,SftpCreateDir,SftpDeleteFromServer,SftpMoveFromServer,SftpMoveToServer
Provides abstract sftp tasks.
-
Field Summary
Fields inherited from class jp.ecuacion.tool.housekeepfiles.bl.task.AbstractTask
dlog, doesCreateOutputFileAutomatically, inputRuleForDestPathInfo, inputRuleForSrcPathInfo, taskPtn -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddoSpecificTask(ConnectionToRemoteServer connection, HousekeepFilesTaskRecord taskRec, String fromPath, String toPath, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList) Executes task.protected voiddoTaskInternal(ConnectionToRemoteServer connection, HousekeepFilesTaskRecord taskRec, String fromPath, String toPath, List<jp.ecuacion.lib.core.exception.checked.AppException> warnList) doTaskから呼び出される。getConnection(String remoteHost, Map<String, HousekeepFilesAuthRecord> authMap) それぞれのremote通信に対するconnection。"SFTP"などのprotocolを設定。com.jcraft.jsch.ChannelSftp.LsEntrygetRemoteDetail(com.jcraft.jsch.ChannelSftp channel, String path) 指定したパスをLsEntry形式で返す。List<com.jcraft.jsch.ChannelSftp.LsEntry> getRemoteDirChildrenList(com.jcraft.jsch.ChannelSftp channel, String dirPath) フォルダはあるが配下のファイル/フォルダがないのと、フォルダがない、またはpathがファイルの場合を区別するため、後者はエラーとする。getRemoteDirChildrenNameList(com.jcraft.jsch.ChannelSftp channel, String dirPath) フォルダはあるが配下のファイル/フォルダがないのと、フォルダがない、またはpathがファイルの場合を区別するため、後者はエラーとする。protected FileInfogetRemoteFileInfo(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path) getRemoteFileInfoList(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path) Returns specified file or directory if exists.booleanremoteDirExists(com.jcraft.jsch.ChannelSftp channel, String path) booleanremoteExists(com.jcraft.jsch.ChannelSftp channel, String path) booleanremoteFileExists(com.jcraft.jsch.ChannelSftp channel, String path) Methods inherited from class jp.ecuacion.tool.housekeepfiles.bl.task.AbstractTask
check, checkNeedRemoteServer, doesCreateOutputFileAutomatically, doTask, getFromDirFileInfoList, getInputRuleForDestPath, getInputRuleForSrcPath, getLocalFileInfo, getLocalFileInfoList, getTaskActionKind, getToPathFileInfo, hasDestPathInfo, hasSrcPathInfo, isDestPathLocal, isSrcPathLocal, localDirExists, taskDependentCheck, treatDestPathExists, treatIncident
-
Constructor Details
-
AbstractTaskSftp
public AbstractTaskSftp()
-
-
Method Details
-
getConnectionProtocol
Description copied from class:AbstractTask"SFTP"などのprotocolを設定。localの場合はnull。- Specified by:
getConnectionProtocolin classAbstractTask
-
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:AbstractTaskdoTaskから呼び出される。各taskにて処理実装。- Specified by:
doTaskInternalin classAbstractTask
-
getConnection
public ConnectionToSftpServer getConnection(String remoteHost, Map<String, HousekeepFilesAuthRecord> authMap) throws ExceptionDescription copied from class:AbstractTaskそれぞれのremote通信に対するconnection。- Specified by:
getConnectionin classAbstractTask- Throws:
Exception
-
getRemoteFileInfo
protected FileInfo getRemoteFileInfo(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path) - Specified by:
getRemoteFileInfoin classAbstractTask
-
getRemoteFileInfoList
protected List<FileInfo> getRemoteFileInfoList(AbstractTask task, ConnectionToRemoteServer connection, boolean isPathDir, String path) Returns specified file or directory if exists.- Specified by:
getRemoteFileInfoListin classAbstractTask
-
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
-