private boolean stage7(final ProtoNetwork pn, final Document doc) {
        beginStage(PHASE1_STAGE7_HDR, "7", NUM_PHASES);
        final StringBuilder bldr = new StringBuilder();

        bldr.append("Saving proto-network for ");
        bldr.append(doc.getName());
        stageOutput(bldr.toString());

        long t1 = currentTimeMillis();
        String dir = artifactPath.getAbsolutePath();
        final String path = asPath(dir, nextUniqueFolderName());
        File pnpathname = new File(path);

        boolean success = true;
        try {
            p1.stage7Saving(pn, pnpathname);

            if (withDebug()) {
                TextProtoNetworkExternalizer textExternalizer =
                        new TextProtoNetworkExternalizer();
                textExternalizer.writeProtoNetwork(pn,
                        pnpathname.getAbsolutePath());
            }
        } catch (ProtoNetworkError e) {
            success = false;
            error("failed to save proto-network");
            e.printStackTrace();
        }
        long t2 = currentTimeMillis();

        bldr.setLength(0);
        markTime(bldr, t1, t2);
        markEndStage(bldr);
        stageOutput(bldr.toString());

        return success;
    }
private boolean stage7 ( final ProtoNetwork pn , final Document doc ) { beginStage ( PHASE1_STAGE7_HDR , "7" , NUM_PHASES ) ; final StringBuilder bldr = new StringBuilder ( ) ; bldr . append ( "Saving proto-network for " ) ; bldr . append ( doc . getName ( ) ) ; stageOutput ( bldr . toString ( ) ) ; long t1 = currentTimeMillis ( ) ; String dir = artifactPath . getAbsolutePath ( ) ; final String path = asPath ( dir , nextUniqueFolderName ( ) ) ; File pnpathname = new File ( path ) ; boolean success = true ; try { p1 . stage7Saving ( pn , pnpathname ) ; if ( withDebug ( ) ) { TextProtoNetworkExternalizer textExternalizer = new TextProtoNetworkExternalizer ( ) ; textExternalizer . writeProtoNetwork ( pn , pnpathname . getAbsolutePath ( ) ) ; } } catch ( ProtoNetworkError e ) { success = false ; error ( "failed to save proto-network" ) ; e . printStackTrace ( ) ; } long t2 = currentTimeMillis ( ) ; bldr . setLength ( 0 ) ; markTime ( bldr , t1 , t2 ) ; markEndStage ( bldr ) ; stageOutput ( bldr . toString ( ) ) ; return success ; }
Stage seven saving of proto-network.

@param pn Proto-network
@param doc {@link Document}, the document
@return boolean true if success, false otherwise