List of usage examples for org.springframework.integration.sftp.session SftpRemoteFileTemplate SftpRemoteFileTemplate
public SftpRemoteFileTemplate(SessionFactory<LsEntry> sessionFactory)
From source file:org.springframework.integration.sftp.outbound.SftpServerOutboundTests.java
@Test public void testInt3412FileMode() { Message<String> m = MessageBuilder.withPayload("foo").setHeader(FileHeaders.FILENAME, "appending.txt") .build();// w w w. j a v a2 s. c o m appending.send(m); appending.send(m); SftpRemoteFileTemplate template = new SftpRemoteFileTemplate(sessionFactory); assertLength6(template); ignoring.send(m); assertLength6(template); try { failing.send(m); fail("Expected exception"); } catch (MessagingException e) { assertThat(e.getCause().getCause().getMessage(), containsString("The destination file already exists")); } }