You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class SmbMessageHandler extends FileTransferringMessageHandler<SmbFile>{
public SmbMessageHandler (SmbRemoteFileTemplate s, FileExistsMode m){
super (s, m);
}
public SmbMessageHandler (SessionFactory<SmbFile> f){
this(new SmbRemoteFileTemplate(f));
}
public SmbMessageHandler (SmbRemoteFileTemplate s{
super (s);
}
public boolean isChmodCapable(){ return false; }
}
Then used it in a spring integration flow like this:
@Bean("smbMessageHandler")
public MessageHandle smbMessageHandler(FileNameGenerator g){
SmbMessageHandler h = new SmbMessageHandler(smbRemoteFileTemplate, REPLACE);
h.setAutoCreateDirectory(true);
h.setRemoteDirectoryExpression("dir1/dir2/dir3/dir4/");
h.setFileNameGenerator (g);
return h;
}
And when I run the flow everything is fine as long as at least the folders dir1, dir2, dir3 are already created, it managed to create dir4 if is not available. But if dir3 (or below, like dir1 or dir2) are not already created, the component fails with:
jcifs.smb.SmbException: The network name cannot be found
What can I do in order to make it create all the necessary folders, no matter how many?
I've created a class like this:
Then used it in a spring integration flow like this:
And when I run the flow everything is fine as long as at least the folders dir1, dir2, dir3 are already created, it managed to create dir4 if is not available. But if dir3 (or below, like dir1 or dir2) are not already created, the component fails with:
What can I do in order to make it create all the necessary folders, no matter how many?