camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bela <>
Subject SftpProducer bug
Date Thu, 24 Jul 2008 21:06:57 GMT


First let me say it's been a huge fun working with Camel! Keep up the good

I have just built 1.5 from the trunk and it seems there's a bug in the
SftpProducer. I know this is not the way to report it, but for now I'm
swamped ... I promise I'll submit patches later. 

The problem is that the mkdir in the buildDirectory throws an exception when
the folder exists and it's not caught. With the current code you can only
send files to the "." (i.e. without specifying a folder).

Here is my humble change:

    protected static boolean buildDirectory(ChannelSftp sftpClient, String
        throws IOException, SftpException {

        boolean atLeastOneSuccess = false;
        final StringBuilder sb = new StringBuilder(dirName.length());
        final String[] dirs = dirName.split("\\/");
        for (String dir : dirs) {
            String directory = sb.toString();

            if (LOG.isDebugEnabled()) {
                LOG.debug("Trying to build directory: " + directory);
            try {
                atLeastOneSuccess = true;
            catch ( SftpException e ) {
            	// Nothing. Keep trying ..

        return atLeastOneSuccess;

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message