attachOutputRes.equals( outputDir.toString() ) ); entry.setSaveAttachment( true ); entry.setDifferentFolderForAttachment( true ); String attachRes = entry.createOutputDirectory( JobEntryGetPOP.FOLDER_ATTACHMENTS );
entry.setSaveAttachment( true ); entry.setOutputDirectory( outputDir.getAbsolutePath() ); entry.setDifferentFolderForAttachment( true );
/** * PDI-11943 - Get Mail Job Entry: Attachments folder not created * * Test that the Attachments folder is created when the entry is * configured to save attachments and messages in the same folder * * @throws IOException */ @Test public void testCreateSameAttachmentsFolder() throws IOException { File attachmentsDir = new File( TestUtils.createTempDir() ); attachmentsDir.deleteOnExit(); entry.setCreateLocalFolder( true ); entry.setSaveAttachment( true ); entry.setOutputDirectory( attachmentsDir.getAbsolutePath() ); entry.setDifferentFolderForAttachment( false ); String outputFolderName = ""; String attachmentsFolderName = ""; try { outputFolderName = entry.createOutputDirectory( JobEntryGetPOP.FOLDER_OUTPUT ); attachmentsFolderName = entry.createOutputDirectory( JobEntryGetPOP.FOLDER_ATTACHMENTS ); } catch ( Exception e ) { fail( "Could not create folder " + e.getLocalizedMessage() ); } assertTrue( "Output Folder should be a local path", !Utils.isEmpty( outputFolderName ) ); assertTrue( "Attachment Folder should be a local path", !Utils.isEmpty( attachmentsFolderName ) ); assertTrue( "Output and Attachment Folder should match", outputFolderName.equals( attachmentsFolderName ) ); }
/** * PDI-11943 - Get Mail Job Entry: Attachments folder not created * * Test that the Attachments folder is created when the entry is * configured to save attachments and messages in different folders * * @throws IOException */ @Test public void testCreateDifferentAttachmentsFolder() throws IOException { File outputDir = new File( TestUtils.createTempDir() ); File attachmentsDir = new File( TestUtils.createTempDir() ); entry.setCreateLocalFolder( true ); entry.setSaveAttachment( true ); entry.setOutputDirectory( outputDir.getAbsolutePath() ); entry.setDifferentFolderForAttachment( true ); entry.setAttachmentFolder( attachmentsDir.getAbsolutePath() ); String outputFolderName = ""; String attachmentsFolderName = ""; try { outputFolderName = entry.createOutputDirectory( JobEntryGetPOP.FOLDER_OUTPUT ); attachmentsFolderName = entry.createOutputDirectory( JobEntryGetPOP.FOLDER_ATTACHMENTS ); } catch ( Exception e ) { fail( "Could not create folder: " + e.getLocalizedMessage() ); } assertTrue( "Output Folder should be a local path", !Utils.isEmpty( outputFolderName ) ); assertTrue( "Attachment Folder should be a local path", !Utils.isEmpty( attachmentsFolderName ) ); assertFalse( "Output and Attachment Folder should not match", outputFolderName.equals( attachmentsFolderName ) ); }
jobEntry.setPassword( wPassword.getText() ); jobEntry.setUseSSL( wUseSSL.getSelection() ); jobEntry.setSaveAttachment( wGetAttachment.getSelection() ); jobEntry.setSaveMessage( wGetMessage.getSelection() ); jobEntry.setDifferentFolderForAttachment( wDifferentFolderForAttachment.getSelection() );