Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeanIOFlatFileItemWriter - FooterCallback compatibility #133

Open
adrianodsq opened this issue Jan 16, 2018 · 0 comments
Open

BeanIOFlatFileItemWriter - FooterCallback compatibility #133

adrianodsq opened this issue Jan 16, 2018 · 0 comments

Comments

@adrianodsq
Copy link

The class BeanIOFlatFileItemWriter already have a FlatFileHeaderCallback attribute, but don't have a FlatFileFooterCallback.
It would be great if it was possible to use it too, just like FlatFileItemWriter.

I guess that all it takes is to implement the usage on the "close()". Since all the attributes are private and inner classes, it cannot be extended or overrided to have acess to Stream.

public void close() throws ItemStreamException {
        if (stream != null) {
            try {
                if (footerCallback != null && stream.writer != null) {
                    footerCallback.writeFooter(stream.writer);
                    stream.writer.flush();
                }
            } catch (IOException e) {
                throw new ItemStreamException("Failed to write footer before closing", e);
            } finally {
                stream.close();
                stream = null;
            }
        }
    }

Thanks for the great lib!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant