INT-1756 added support for auto-creating remote directories
This commit is contained in:
@@ -140,4 +140,12 @@ class SftpSession implements Session {
|
||||
}
|
||||
}
|
||||
|
||||
public void mkdir(String directory) throws IOException {
|
||||
try {
|
||||
this.channel.mkdir(directory);
|
||||
} catch (SftpException e) {
|
||||
throw new NestedIOException("failed to create remote directory '" + directory + "'.", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -77,6 +77,14 @@
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
|
||||
<xsd:attribute name="auto-create-directory" type="xsd:string" default="false">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Specify whether to automatically create the remote target directory if it doesn't exist.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="remote-filename-generator" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
|
||||
@@ -64,7 +64,7 @@ public class SftpInboundOutboundSanitySample {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
//@Ignore
|
||||
public void testOutbound() throws Exception{
|
||||
ApplicationContext ac =
|
||||
new ClassPathXmlApplicationContext("SftpOutboundTransferSample-ignored.xml", this.getClass());
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
charset="UTF-8"
|
||||
temporary-file-suffix=".foo"
|
||||
remote-filename-generator-expression="payload.getName() + '-foo'"
|
||||
remote-directory="/Users/ozhurakousky/workspace-sts-2.3.3.M2/si/spring-integration/spring-integration-sftp/remote-target-dir"/>
|
||||
auto-create-directory="true"
|
||||
remote-directory="/Users/ozhurakousky/workspace-sts-2.3.3.M2/si/spring-integration/spring-integration-sftp/remote-target-dir/foo/bar/baz"/>
|
||||
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user