これが私のメインクラスftpサーバに接続しましたが、Springの統合でファイルがダウンロードされていない人は誰でもこれを修正できますか?
public class FtpInboundChannelAdapterSample {
private static final Logger LOGGER = LoggerFactory.getLogger(FtpInboundChannelAdapterSample.class);
public static void main(String[] args) throws Exception {
FtpInboundChannelAdapterSample ftp=new FtpInboundChannelAdapterSample();
ftp.ftpDownload();
}
public void ftpDownload() throws Exception {
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
"META-INF/spring/integration/FtpInboundChannelAdapterSample-context.xml");
PollableChannel ftpChannel = ctx.getBean("ftpChannel", PollableChannel.class);
System.out.println("Files are transferred ");
ctx.close();
}
}
され、
<bean id="ftpClientFactory" class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory">
<property name="host" value="${host}"/>
<property name="port" value="${availableServerPort}"/>
<property name="username" value="${userid}"/>
<property name="password" value="${password}"/>
</bean>
<int-ftp:inbound-channel-adapter id="ftpInbound"
channel="ftpChannel"
session-factory="ftpClientFactory"
filename-pattern="*.*"
auto-create-local-directory="true"
delete-remote-files="false"
remote-directory="ftp://portal.********.com/foldername/"
local-directory="${localDir}">
<int:poller fixed-rate="1000"/>
</int-ftp:inbound-channel-adapter>
<int:channel id="ftpChannel">
<int:queue/>
</int:channel>
に従うように私の.xmlがあり、これはリモートディレクトリを与えるための方法ですパス?
リモートディレクトリ= "FTP://portal.********.com/foldername/"
又は
リモートディレクトリ= "/ ftpSample /"
私はこれを試してみてください。..
実際に私はサーバーとして考えて、私の同僚のシステムと接続しようとしましたftp接続が確立されており、そのシステムで印刷されたログは以下に与えました – User6375442
別の答え;それを削除し、代わりにあなたの質問を編集する必要があります。また、より良い書式を設定する必要があります。アクセス許可の問題のように見える ''/"の転送のためのデータ接続を開くことができません - スラッシュを削除してください。 –
ありがとうゲーリーファイアウォールやウイルス対策のためだけに許可の問題でした。 – User6375442