Changeset 1446

Show
Ignore:
Timestamp:
10/23/06 19:51:51 (2 years ago)
Author:
aldrinleal
Message:

WikiOutputStreamPlugin:

- Added mode for complete Disabling of WikiPageOutputStream?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wikioutputstreamplugin/anyrelease/src/main/java/br/eng/leal/trac/WikiPageOutputStream.java

    r1410 r1446  
    4949 
    5050        /** 
     51         * Or someone override the properties, thus disabling its use 
     52         */ 
     53        private static final RuntimeException DISABLED_EXCEPTION = new IllegalArgumentException( 
     54                        "WikiPageOutputStream class is Disabled for Construction!"); 
     55 
     56        /** 
    5157         * PROPERTY KEY CONSTANT FOR: Remote Trac User 
    5258         */ 
     
    8389         */ 
    8490        private static final String REMOTE_TRAC_USER_KEY = "remote.trac.user.key"; 
     91 
     92        /** 
     93         * PROPERTY KEY FOR: OVERRIDE WikiPageOutputStream, thus disabling 
     94         * construction; 
     95         */ 
     96        private static final String WIKIOUTPUTSTREAM_DISABLED = "wiki.disabled"; 
    8597 
    8698        /** 
     
    143155         *  
    144156         * <pre> 
    145          *          cat &gt; tmpfilename &amp;&amp; trac-admin TRACDB wiki import page tmpFile &amp;&amp; rm -f tmpfilename 
     157         *            cat &gt; tmpfilename &amp;&amp; trac-admin TRACDB wiki import page tmpFile &amp;&amp; rm -f tmpfilename 
    146158         * </pre> 
    147159         *  
     
    205217                String keyFile = getProperty(properties, REMOTE_TRAC_USER_KEY, 
    206218                                KEYFILE_MISSING_ILLEGAL_ARGUMENT_EXCEPTION); 
     219                Boolean disabled = Boolean.parseBoolean(getProperty(properties, 
     220                                WIKIOUTPUTSTREAM_DISABLED, "false")); 
     221 
     222                if (null != disabled) 
     223                        if (disabled.booleanValue()) 
     224                                throw DISABLED_EXCEPTION; 
    207225 
    208226                init(page, remoteUser, remoteHost, remotePort, tracDb, tracAdmin, 
     
    232250         *  
    233251         * <pre> 
    234          *      Remote User@Remote Host:Remote Port 
     252         *        Remote User@Remote Host:Remote Port 
    235253         * </pre> 
    236254         *  
     
    271289         *  
    272290         * <pre> 
    273          *      Remote User@Remote Host:Remote Port 
     291         *        Remote User@Remote Host:Remote Port 
    274292         * </pre> 
    275293         *