Package org.apache.commons.io.output

Examples of org.apache.commons.io.output.NullOutputStream


        this.sitemapBuilder = (SitemapBuilder) applicationContext.getBean("org.apache.cocoon.sitemap.SitemapBuilder");
        this.sitemap = this.sitemapBuilder.build(sitemapURL);
    }

    private Invocation buildInvocation(String request) {
        InvocationImpl invocation = new InvocationImpl(new NullOutputStream());

        invocation.setBaseURL(this.getClass().getResource("/COB-INF/"));
        invocation.setRequestURI(request);
        invocation.setComponentProvider(this.componentProvider);
        invocation.setObjectModel(new ObjectModel(new HashMap<String, Object>()));
View Full Code Here


   */
  protected FormattingResults calcResults(FopFactory fopFactory, String outputFormat, Source foDocumentSrc, PlaceholderReplacementHandler.PlaceholderLookup placeholderLookup) throws Docx4JException {
    Fop fop = null;
    Result result = null;
    try {
      fop = fopFactory.newFop(outputFormat, new NullOutputStream());
      result = new SAXResult(new PlaceholderReplacementHandler(fop.getDefaultHandler(), placeholderLookup));
    } catch (FOPException e) {
      throw new Docx4JException("Exception setting up result for fo transformation: " + e.getMessage(), e);
    }

View Full Code Here

     * This method is overloaded because we want to use our own PDFDocument
     * and extended PDFFactory implementation.
     */
    public void startRenderer(OutputStream stream) throws IOException {
        // do parent initialization but do not write anything to output
        OutputStream dummyStream = new NullOutputStream();
        super.startRenderer(dummyStream);

        ostream = stream;

        // Generate PDF producer string
View Full Code Here

    private void ignoreError(final Process process) {
        new Thread() {
            public void run() {
                InputStream error = process.getErrorStream();
                try {
                    IOUtils.copy(error, new NullOutputStream());
                } catch (IOException e) {
                } finally {
                    IOUtils.closeQuietly(error);
                }
            }
View Full Code Here

     * Test Copying file > 2GB  - see issue# IO-84
     */
    public void testCopy_inputStreamToOutputStream_IO84() throws Exception {
        long size = (long)Integer.MAX_VALUE + (long)1;
        InputStream  in  = new NullInputStream(size);
        OutputStream out = new NullOutputStream();

        // Test copy() method
        assertEquals(-1, IOUtils.copy(in, out));

        // reset the input
View Full Code Here

     */
    public void testLargeFiles_IO84() throws Exception {
        long size = (long)Integer.MAX_VALUE + (long)1;
        NullInputStream mock    = new NullInputStream(size);
        CountingInputStream cis = new CountingInputStream(mock);
        OutputStream out        = new NullOutputStream();

        // Test integer methods
        IOUtils.copyLarge(cis, out);
        try {
            cis.getCount();
View Full Code Here

    argList.add(sqlScriptFile);

    // run the script using Beeline
    BeeLine beeLine = new BeeLine();
    if (!verbose) {
      beeLine.setOutputStream(new PrintStream(new NullOutputStream()));
      beeLine.getOpts().setSilent(true);
    }
    beeLine.getOpts().setAllowMultiLineCommand(false);
    beeLine.getOpts().setIsolation("TRANSACTION_READ_COMMITTED");
    int status = beeLine.begin(argList.toArray(new String[0]), null);
View Full Code Here

            throw new IllegalArgumentException("Checksums can't be computed on directories");
        }
        InputStream in = null;
        try {
            in = new CheckedInputStream(new FileInputStream(file), checksum);
            IOUtils.copy(in, new NullOutputStream());
        } finally {
            IOUtils.closeQuietly(in);
        }
        return checksum;
    }
View Full Code Here

    public Checksum update( InputStream stream )
        throws IOException
    {
        DigestInputStream dig = new DigestInputStream( stream, md );
        IOUtils.copy( dig, new NullOutputStream() );

        return this;
    }
View Full Code Here

    }

    @Test
    public void the_toString_of_the_original_commands_should_not_be_hidden() {
        SpyExecutor backingExecutor = new SpyExecutor();
        InternalErrorReportingExecutor executor = new InternalErrorReportingExecutor(backingExecutor, suiteListener, new PrintStream(new NullOutputStream()));
        Runnable originalCommand = () -> {
        };

        executor.execute(originalCommand);
View Full Code Here

TOP

Related Classes of org.apache.commons.io.output.NullOutputStream

Copyright © 2018 www.massapicom. 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.