スプリング統合を使用してファイルをある場所から別の場所にコピーする方法を教えてください。私の場合、私は戦争の外のファイルを戦争の中にコピーしたいと思っています。ここで私が考えていたコードスニペットです:スプリング統合を使用したコピーファイル
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/integration"
xmlns:file="http://www.springframework.org/schema/integration/file"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-1.0.xsd
http://www.springframework.org/schema/integration/mail http://www.springframework.org/schema/integration/mail/spring-integration-mail-1.0.xsd
">
<poller max-messages-per-poll="1" id="defaultPoller" default="true">
<interval-trigger interval="1000"/>
</poller>
<file:inbound-channel-adapter id="filesIn"
filename-pattern="ha-jdbc-cluster1.xml"
directory="file:/etc/****/" />
<file:outbound-channel-adapter id="filesOut" directory="classpath:/WEB-INF/classes" />
けど恥それは動作しません。誰もそれを行う方法を知っていますか?
ありがとうございました.....
あなたの記事のおかげで、私がここでやろうとしていることは、戦争の外から戦争の中に設定ファイルを取得することです。ユーザーはそれを外から設定することができます。戦争の中で引っ張って、アプリはそれに応じて動作します。あなたの協力のおかげで何かを説明する必要があるかどうか私に教えてください。私はこのフォーラムが大好きです。 – Ikthiander
残念ながら、このアプローチはうまくいきません。クラスローダーは、アプリケーションの起動後に更新されたファイルを表示しません。私は別の場所に設定ファイルを保持し、あなたのapp/webサーバのクラスパスを設定するように設定することをお勧めします。 –