クラス FtpRemoteFileTemplate
java.lang.ObjectSE
org.springframework.integration.file.remote.RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile>
org.springframework.integration.ftp.session.FtpRemoteFileTemplate
- 実装されているすべてのインターフェース:
Aware、BeanFactoryAware、InitializingBean、RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>
基になる FTPClient オブジェクトへの型安全なアクセスを提供する
RemoteFileTemplate の FTP バージョン。- 導入:
- 4.1
- 作成者:
- Gary Russell, Artem Bilan
ネストされたクラスの要約
ネストされたクラスインターフェース org.springframework.integration.file.remote.RemoteFileOperations から継承されたネストクラス / インターフェース
RemoteFileOperations.OperationsCallback<F,T> フィールドのサマリー
クラス org.springframework.integration.file.remote.RemoteFileTemplate から継承されたフィールド
logger, sessionFactoryコンストラクターの概要
コンストラクターコンストラクター説明FtpRemoteFileTemplate(SessionFactory<org.apache.commons.net.ftp.FTPFile> sessionFactory) 方法の概要
修飾子と型メソッド説明protected <T> @Nullable TdoExecuteWithClient(ClientCallback<org.apache.commons.net.ftp.FTPClient, T> callback) <T,C> @Nullable T executeWithClient(ClientCallback<C, T> callback) セッションのクライアントを取得した後、コールバックの doWithClient メソッドを実行し、低レベルメソッドへのアクセスを提供します。booleanこの特定の FTP 実装はデフォルトでFTPClient.getStatus(String)に基づいていますが、すべての FTP サーバーがSTATコマンドを適切に実装するわけではないため、フレームワーク内部FtpRemoteFileTemplateインスタンスはファイル操作のみのためにFTPClient.listNames(String)に切り替えられます。protected booleanisStatusDirty(StringSE ftpErrorMessage) Throwable.getMessage()が致命的として扱われるかどうかを確認します。voidsetExistsMode(FtpRemoteFileTemplate.ExistsMode existsMode) exists(String)操作のFtpRemoteFileTemplate.ExistsModeを指定します。protected booleanコールバックから例外がスローされたときに、RemoteFileTemplate.execute(SessionCallback)でSession.dirty()を呼び出す必要があるかどうかを決定します。クラス org.springframework.integration.file.remote.RemoteFileTemplate から継承されたメソッド
afterPropertiesSet, append, append, execute, get, get, getDirectoryExpressionProcessor, getRemoteFileSeparator, getSession, getSessionFactory, getTemporaryFileSuffix, invoke, isUseTemporaryFileName, list, remove, rename, send, send, setAutoCreateDirectory, setBeanFactory, setCharset, setFileNameExpression, setFileNameGenerator, setRemoteDirectoryExpression, setRemoteFileSeparator, setTemporaryFileSuffix, setTemporaryRemoteDirectoryExpression, setUseTemporaryFileName
コンストラクターの詳細
FtpRemoteFileTemplate
メソッドの詳細
executeWithClient
インターフェースからコピーされた説明:RemoteFileOperationsセッションのクライアントを取得した後、コールバックの doWithClient メソッドを実行し、低レベルのメソッドへのアクセスを提供します。メソッドが終了すると、セッションを確実に閉じます。- 次で指定:
- インターフェース
RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>のexecuteWithClient - オーバーライド:
- クラス
RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile>のexecuteWithClient - 型パラメーター:
T-ClientCallback.doWithClient(Object)によって返される型。C- 基礎となるクライアントオブジェクトの型。- パラメーター:
callback- ClientCallback。- 戻り値:
- コールバックメソッドの結果。
setExistsMode
exists(String)操作のFtpRemoteFileTemplate.ExistsModeを指定します。デフォルトはFtpRemoteFileTemplate.ExistsMode.STATです。ファイル操作のためにフレームワークコンポーネントによって内部的に使用される場合、FtpRemoteFileTemplate.ExistsMode.NLSTに切り替えられます。- パラメーター:
existsMode- 使用するFtpRemoteFileTemplate.ExistsMode。- 導入:
- 4.1.9
doExecuteWithClient
protected <T> @Nullable T doExecuteWithClient(ClientCallback<org.apache.commons.net.ftp.FTPClient, T> callback) exists
この特定の FTP 実装はデフォルトでFTPClient.getStatus(String)に基づいていますが、すべての FTP サーバーがSTATコマンドを適切に実装するわけではないため、フレームワーク内部FtpRemoteFileTemplateインスタンスはファイル操作のみのためにFTPClient.listNames(String)に切り替えられます。モードは
setExistsMode(ExistsMode)プロパティで切り替えることができます。FtpRemoteFileTemplateの拡張で任意のカスタム実装を実行できます。- 次で指定:
- インターフェース
RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>のexists - オーバーライド:
- クラス
RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile>のexists - パラメーター:
path- チェックするリモートファイルパス。- 戻り値:
- リモートファイルが存在するかどうかは true または false です。
shouldMarkSessionAsDirty
クラスからコピーされた説明:RemoteFileTemplateコールバックから例外がスローされたときに、RemoteFileTemplate.execute(SessionCallback)でSession.dirty()を呼び出す必要があるかどうかを決定します。デフォルトでは、このメソッドはtrueを返します。リモートファイルプロトコル拡張機能は、このメソッドをオーバーライドして、スローされた例外に対する特定の戦略を提供できます。file not foundエラーは、セッションが切断されたことを示すシグナルではありません。- オーバーライド:
- クラス
RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile>のshouldMarkSessionAsDirty - パラメーター:
ex-Sessionをダーティとしてマークする必要があるかどうかをチェックする例外。- 戻り値:
Session.dirty()を呼び出す必要がある場合は true。
isStatusDirty
Throwable.getMessage()が致命的として扱われるかどうかを確認します。- パラメーター:
ftpErrorMessage-Throwable.getMessage()からの値。- 戻り値:
Throwable.getMessage()が致命的として扱われる場合は true。- 導入:
- 6.0.8