Spring Integration doesn't synchronize with FTP mainframe system
<p>I am trying to sycronize an FTP folder with a local directory. This FTP server is running on z/OS, it's a mainframe with he MVS operating system.</p>

<p>So far I've had a lot of problems even to manage to connect to the folder I needed because this system doesn't have a "normal" folder system.</p>

<p>This is what I've done to change to the working directory where my files are:</p>

<pre><code>public class DefaultFtpHostSessionFactory extends DefaultFtpSessionFactory {
    protected void postProcessClientAfterConnect(FTPClient ftp) throws IOException {
        ftp.changeToParentDirectory();
        ftp.changeWorkingDirectory("E377D.");
    }
}
</code></pre>

<p>Now I've defined an input-channel-adapter:</p>

<pre><code>&lt;int-ftp:inbound-channel-adapter 
        id="ljFtpInbound"
        channel="ljFtpChannel"
        session-factory="ljCachingSessionFactory"
        auto-create-local-directory="true"
        delete-remote-files="false"
        filename-pattern="*"
        remote-directory="*"
        remote-file-separator=""
        charset="UTF-8"
        auto-startup="true"
        preserve-timestamp="false"
        local-filename-generator-expression="#this.toUpperCase()"
        temporary-file-suffix=".writing"
        local-directory="/tmp/"&gt;
    &lt;int:poller fixed-rate="1000" /&gt;
&lt;/int-ftp:inbound-channel-adapter&gt;
</code></pre>

<p>As you can notice the remote directory is "*", that's for listing the directory, at least is the only way I've managed to do it.</p>

<p>But when FtpInboundFileSynchronizer tries to synchronize the folder I get an error because when it tries to copy the file the path is build with:</p>

<pre><code>String remoteFilePath = remoteDirectoryPath + remoteFileSeparator + remoteFileName;
</code></pre>

<p>Which in my case would be "ASTERISK" + "BLANK" + "REMOTE_FILE_NAME", because I had to use "*" as the remote-directory, so it doesn't find the file.</p>

<p>¿Do you know if I can not to set the remote-directory (which I tried but didn't achieve)? Or there is another way to synchronized this weird FTP system.</p>

<p>Thank you.</p>