String path = System.getProperty( PROFILE_KEY ); if( null != path ) { URL url = new URL( path ); InputStream input = url.openStream(); XMLDecoder decoder = new XMLDecoder( new BufferedInputStream( input ) ); TransitDirective directive = (TransitDirective) decoder.readObject(); return new DefaultTransitModel( logger, directive ); } else { File prefs = Transit.DPML_PREFS; File config = new File( prefs, "dpml/transit/xmls/config.xml" ); if( config.exists() ) { FileInputStream input = new FileInputStream( config ); XMLDecoder decoder = new XMLDecoder( new BufferedInputStream( input ) ); TransitDirective directive = (TransitDirective) decoder.readObject(); return new DefaultTransitModel( logger, directive ); } else { return getClassicModel( logger ); } }
LoggingAdapter adapter = new LoggingAdapter( "transit" ); return getDefaultModel( adapter );
    public static TransitModel getDefaultModel( Logger logger ) throws Exception    {        String path = System.getProperty( PROFILE_KEY );        if( null != path )        {            URL url = new URL( path );            InputStream input = url.openStream();            XMLDecoder decoder = new XMLDecoder( new BufferedInputStream( input ) );            TransitDirective directive = (TransitDirective) decoder.readObject();            return new DefaultTransitModel( logger, directive );        }        else        {            File prefs = Transit.DPML_PREFS;            File config = new File( prefs, "dpml/transit/xmls/config.xml" );            if( config.exists() )            {                FileInputStream input = new FileInputStream( config );                XMLDecoder decoder = new XMLDecoder( new BufferedInputStream( input ) );                TransitDirective directive = (TransitDirective) decoder.readObject();                return new DefaultTransitModel( logger, directive );            }            else            {                return getClassicModel( logger );            }        }    }