private void createDocument()

in src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java [610:639]


    private void createDocument( LinkcheckModel model )
        throws IOException
    {
        if ( this.reportOutput == null )
        {
            return;
        }

        File dir = this.reportOutput.getParentFile();
        if ( dir != null && !dir.exists() )
        {
            if ( !dir.mkdirs() )
            {
                throw new IOException( "Could not create " + dir );
            }
        }

        LinkcheckModelXpp3Writer xpp3Writer = new LinkcheckModelXpp3Writer();
        try ( Writer writer = WriterFactory.newXmlWriter( this.reportOutput ) ) 
        {
            xpp3Writer.write( writer, model );
        }
        catch ( IllegalStateException e )
        {
            IOException ioe =
                new IOException( e.getMessage() + " Maybe try to specify another encoding instead of '"
                    + encoding + "'.", e );
            throw ioe;
        }
    }