use of com.adaptris.core.FormattedFilenameCreator in project interlok by adaptris.
the class ReadMetadataFromFilesystemTest method testService_InputXml.
@Test
public void testService_InputXml() throws Exception {
String subDir = new GuidGenerator().getUUID().replaceAll(":", "").replaceAll("-", "");
AdaptrisMessage msg = new DefaultMessageFactory().newMessage();
ReadMetadataFromFilesystem service = createService(subDir);
service.setInputStyle(InputStyle.XML);
service.setFilenameCreator(new FormattedFilenameCreator());
File parentDir = FsHelper.createFileReference(FsHelper.createUrlFromString(PROPERTIES.getProperty(BASE_DIR), true));
String propsFilename = parentDir.getCanonicalPath() + "/" + subDir + "/" + msg.getUniqueId();
Properties p = createProperties();
writeProperties(p, new File(propsFilename), true);
execute(service, msg);
assertTrue(msg.headersContainsKey("key5"));
assertEquals("v5", msg.getMetadataValue("key5"));
}
use of com.adaptris.core.FormattedFilenameCreator in project interlok by adaptris.
the class SftpProducerTest method createProducerExample.
private StandaloneProducer createProducerExample(FileTransferConnection con) {
FtpProducer producer = createProducerExample();
producer.setFilenameCreator(new FormattedFilenameCreator());
producer.setFtpEndpoint("sftp://sftpuser@hostname:port/path/to/directory");
return new StandaloneProducer(con, producer);
}
Aggregations