Package net.sf.flatpack.writer

Examples of net.sf.flatpack.writer.DelimiterWriterFactory.createWriter()


                DelimiterWriterFactory factory = new DelimiterWriterFactory(delimiter, textQualifier);
                // add columns from the keys in the data map as the columns must be known
                for (String key : firstRow.keySet()) {
                    factory.addColumnTitle(key);
                }
                return factory.createWriter(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
            } else {
                InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext().getClassResolver(), getDefinition());
                InputStreamReader reader = new InputStreamReader(is, IOHelper.getCharsetName(exchange));
                DelimiterWriterFactory factory = new DelimiterWriterFactory(reader, delimiter, textQualifier);
                return factory.createWriter(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
View Full Code Here


                return factory.createWriter(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
            } else {
                InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext().getClassResolver(), getDefinition());
                InputStreamReader reader = new InputStreamReader(is, IOHelper.getCharsetName(exchange));
                DelimiterWriterFactory factory = new DelimiterWriterFactory(reader, delimiter, textQualifier);
                return factory.createWriter(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
            }
        }
    }

}
View Full Code Here

                DelimiterWriterFactory factory = new DelimiterWriterFactory(delimiter, textQualifier);
                // add columns from the keys in the data map as the columns must be known
                for (String key : firstRow.keySet()) {
                    factory.addColumnTitle(key);
                }
                return factory.createWriter(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
            } else {
                InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext().getClassResolver(), getDefinition());
                InputStreamReader reader = new InputStreamReader(is, IOHelper.getCharsetName(exchange));
                DelimiterWriterFactory factory = new DelimiterWriterFactory(reader, delimiter, textQualifier);
                return factory.createWriter(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
View Full Code Here

                return factory.createWriter(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
            } else {
                InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext().getClassResolver(), getDefinition());
                InputStreamReader reader = new InputStreamReader(is, IOHelper.getCharsetName(exchange));
                DelimiterWriterFactory factory = new DelimiterWriterFactory(reader, delimiter, textQualifier);
                return factory.createWriter(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
            }
        }
    }

}
View Full Code Here

                DelimiterWriterFactory factory = new DelimiterWriterFactory(delimiter, textQualifier);
                // add coulmns from the keys in the data map as the columns must be known
                for (String key : firstRow.keySet()) {
                    factory.addColumnTitle(key);
                }
                return factory.createWriter(new OutputStreamWriter(stream, IOConverter.getCharsetName(exchange)));
            } else {
                DelimiterWriterFactory factory = new DelimiterWriterFactory(new InputStreamReader(resource.getInputStream(), IOConverter.getCharsetName(exchange)), delimiter, textQualifier);
                return factory.createWriter(new OutputStreamWriter(stream, IOConverter.getCharsetName(exchange)));
            }
        }
View Full Code Here

                    factory.addColumnTitle(key);
                }
                return factory.createWriter(new OutputStreamWriter(stream, IOConverter.getCharsetName(exchange)));
            } else {
                DelimiterWriterFactory factory = new DelimiterWriterFactory(new InputStreamReader(resource.getInputStream(), IOConverter.getCharsetName(exchange)), delimiter, textQualifier);
                return factory.createWriter(new OutputStreamWriter(stream, IOConverter.getCharsetName(exchange)));
            }
        }
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.