Examples of InputFileWrapper


Examples of org.apache.maven.doxia.wrapper.InputFileWrapper

        {
            fw = new FileWriter( outFile );

            StringWriter writer = new StringWriter();

            InputFileWrapper input =
                InputFileWrapper.valueOf( inFile.getAbsolutePath(), from, converter.getInputFormats() );
            OutputFileWrapper output =
                OutputFileWrapper.valueOf( outFile.getAbsolutePath(), to, converter.getOutputFormats() );

            converter.setFormatOutput( formatOutput );
            converter.convert( input, output );

            IOUtil.copy( writer.toString(), fw );

            assertTrue( outFile.exists() );
            assertTrue( outFile.length() != 0 );
        }
        finally
        {
            IOUtil.close( fw );
        }

        in = getBasedir() + "/src/test/resources/unit/apt/test.apt";
        from = null;
        out = getBasedir() + "/target/unit/writer/apt/test.apt.xhtml";
        to = "xhtml";

        inFile = new File( in );
        outFile = new File( out );
        outFile.getParentFile().mkdirs();

        try
        {
            fw = new FileWriter( outFile );

            StringWriter writer = new StringWriter();

            InputFileWrapper input =
                InputFileWrapper.valueOf( inFile.getAbsolutePath(), from, converter.getInputFormats() );
            OutputFileWrapper output =
                OutputFileWrapper.valueOf( outFile.getAbsolutePath(), to, converter.getOutputFormats() );

            converter.setFormatOutput( formatOutput );
            converter.convert( input, output );

            IOUtil.copy( writer.toString(), fw );

            assertTrue( outFile.exists() );
            assertTrue( outFile.length() != 0 );
        }
        finally
        {
            IOUtil.close( fw );
        }

        in = getBasedir() + "/src/test/resources/unit/apt/test.unknown";
        from = null;
        out = getBasedir() + "/target/unit/writer/apt/test.apt.xhtml";
        to = "xhtml";

        inFile = new File( in );
        outFile = new File( out );
        outFile.getParentFile().mkdirs();

        try
        {
            fw = new FileWriter( outFile );

            InputFileWrapper input =
                InputFileWrapper.valueOf( inFile.getAbsolutePath(), from, converter.getInputFormats() );
            OutputFileWrapper output =
                OutputFileWrapper.valueOf( outFile.getAbsolutePath(), to, converter.getOutputFormats() );

            converter.setFormatOutput( formatOutput );
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.