KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > roller > util > OldRollerConfig


1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. The ASF licenses this file to You
4 * under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License. For additional information regarding
15 * copyright in this work, please see the NOTICE file in the top level
16 * directory of this distribution.
17 */

18 package org.apache.roller.util;
19
20 import java.beans.IntrospectionException JavaDoc;
21
22 import java.io.File JavaDoc;
23 import java.io.FileInputStream JavaDoc;
24 import java.io.FileNotFoundException JavaDoc;
25 import java.io.FileOutputStream JavaDoc;
26 import java.io.IOException JavaDoc;
27 import java.io.InputStream JavaDoc;
28 import java.io.OutputStream JavaDoc;
29
30 import java.lang.reflect.AccessibleObject JavaDoc;
31 import java.lang.reflect.Field JavaDoc;
32
33 import java.util.ArrayList JavaDoc;
34 import java.util.Arrays JavaDoc;
35 import java.util.List JavaDoc;
36
37 import org.apache.commons.betwixt.io.BeanReader;
38 import org.apache.commons.betwixt.io.BeanWriter;
39 import org.apache.commons.logging.Log;
40 import org.apache.commons.logging.LogFactory;
41
42 import org.apache.roller.RollerException;
43 import org.apache.roller.pojos.RollerConfigData;
44
45 import org.xml.sax.SAXException JavaDoc;
46
47
48 /**
49  * Configuration object for Roller. Reads and writes roller-config.xml.
50  * This file is a relic of the old days, back when we used to store the Roller
51  * configuration in an XML file. In Roller 0.9.9 and later, this file only
52  * exists to allow use to read only roller-config.xml files on startup and
53  * copy them into the database.
54  */

55 public class OldRollerConfig implements java.io.Serializable JavaDoc
56 {
57     static final long serialVersionUID = -6625873343838437510L;
58     
59     private static Log mLogger =
60         LogFactory.getFactory().getInstance( OldRollerConfig.class );
61
62     /**
63      * Absolute URL for site, for cases where infered absolute URL doesn't
64      * work.
65      */

66     protected String JavaDoc mAbsoluteURL = null;
67
68     /** Should Roller cache return RSS pages. */
69     protected boolean mRssUseCache = false;
70
71     /** Duration to cache RSS pages (in seconds). */
72     protected int mRssCacheTime = 3000;
73
74     /** Does Roller allow the creation of new users. */
75     protected boolean mNewUserAllowed = false;
76
77     /** List of usernames with Admin priviledges. */
78     protected List JavaDoc mAdminUsers = new ArrayList JavaDoc();
79
80     /** Where to get data for creating new users (new-user.xml). */
81     protected String JavaDoc mNewUserData = "/templates";
82
83     /** Where to get Themes presented to new users. */
84     protected String JavaDoc mNewUserThemes = "/themes";
85
86     /** List of "editor pages" for the Weblog entry editor. */
87     protected List JavaDoc mEditorPages = new ArrayList JavaDoc();
88
89     /** Dis/enble RSS aggregation capabilities. */
90     protected boolean mEnableAggregator = false;
91
92     /** Are file uploads enabled. */
93     protected boolean mUploadEnabled = false;
94
95     /** The maximum size of each user's upload directory. */
96     protected Float JavaDoc mUploadMaxDirMB = new Float JavaDoc( "2" );
97
98     /** The maximum size allowed per uploaded file. */
99     protected Float JavaDoc mUploadMaxFileMB = new Float JavaDoc( ".5" );
100
101     /**
102      * List of permitted file extensions (not including the "dot"). This
103      * attribute is mutually exclusive with uploadForbid.
104      */

105     protected List JavaDoc mUploadAllow = new ArrayList JavaDoc();
106
107     /**
108      * List of forbidden file extensions (not including the "dot"). This
109      * attribute is mutually exclusive with uploadAllow.
110      */

111     protected List JavaDoc mUploadForbid = new ArrayList JavaDoc();
112
113     /**
114      * Directory where uploaded files will be stored. May end with a slash.
115      * Optional, this value will default to RollerContext.USER_RESOURCES. If
116      * specified, should be a full path on the system harddrive or relative to
117      * the WebApp.
118      */

119     protected String JavaDoc mUploadDir = "";
120
121     /**
122      * The path from which the webserver will serve upload files. This values
123      * must not end in a slash.
124      */

125     protected String JavaDoc uploadPath = "/resources";
126     protected boolean mMemDebug = false;
127
128     /**
129      * Determines if the Comment page will "autoformat" comments. That is,
130      * replace carriage-returns with <br />.
131      */

132     protected boolean mAutoformatComments = false;
133
134     /** Determines if the Comment page will escape html in comments. */
135     protected boolean mEscapeCommentHtml = false;
136
137     /** Determines if e-mailing comments is enabled. */
138     protected boolean mEmailComments = false;
139
140     /** Enable linkback extraction. */
141     protected boolean mEnableLinkback = false;
142
143     /** Name of this site */
144     protected String JavaDoc mSiteName = "Roller-based Site";
145
146     /** Description of this site */
147     protected String JavaDoc mSiteDescription = "Roller-based Site";
148
149     /** Site administrator's email address */
150     protected String JavaDoc mEmailAddress = "";
151
152     /** Lucene index directory */
153     protected String JavaDoc mIndexDir =
154         "${user.home}" + File.separator + "roller-index";
155
156     /**
157      * Flag for encrypting passwords
158      */

159     protected boolean mEncryptPasswords = false;
160     
161     /** Algorithm for encrypting passwords */
162     protected String JavaDoc mAlgorithm = "SHA";
163     
164     public OldRollerConfig()
165     {
166     }
167
168     public OldRollerConfig( RollerConfigData rConfig )
169     {
170         this.setAbsoluteURL( rConfig.getAbsoluteURL() );
171         this.setRssUseCache( rConfig.getRssUseCache().booleanValue() );
172         this.setRssCacheTime( rConfig.getRssCacheTime().intValue() );
173         this.setNewUserAllowed( rConfig.getNewUserAllowed().booleanValue() );
174         this.setNewUserThemes( rConfig.getUserThemes() );
175         this.setEditorPages( rConfig.getEditorPagesList() );
176         this.setEnableAggregator( rConfig.getEnableAggregator().booleanValue() );
177         this.setUploadEnabled( rConfig.getUploadEnabled().booleanValue() );
178         this.setUploadMaxDirMB( new Float JavaDoc( rConfig.getUploadMaxDirMB()
179                                                   .doubleValue() ) );
180         this.setUploadMaxFileMB( new Float JavaDoc( rConfig.getUploadMaxFileMB()
181                                                    .doubleValue() ) );
182         this.setUploadAllow( Arrays.asList( rConfig.uploadAllowArray() ) );
183         this.setUploadForbid( Arrays.asList( rConfig.uploadForbidArray() ) );
184         this.setUploadDir( rConfig.getUploadDir() );
185         this.setUploadPath( rConfig.getUploadPath() );
186         this.setMemDebug( rConfig.getMemDebug().booleanValue() );
187         this.setAutoformatComments( rConfig.getAutoformatComments()
188                                            .booleanValue() );
189         this.setEscapeCommentHtml( rConfig.getEscapeCommentHtml()
190                                           .booleanValue() );
191         this.setEmailComments( rConfig.getEmailComments().booleanValue() );
192         this.setEnableLinkback( rConfig.getEnableLinkback().booleanValue() );
193         this.setSiteName( rConfig.getSiteName() );
194         this.setSiteDescription( rConfig.getSiteDescription() );
195         this.setEmailAddress( rConfig.getEmailAddress() );
196         this.setIndexDir( rConfig.getIndexDir() );
197         this.setEncryptPasswords( rConfig.getEncryptPasswords().booleanValue() );
198         this.setAlgorithm( rConfig.getAlgorithm() );
199     }
200
201     //-------------------------------------- begin requisite getters & setters
202
public String JavaDoc getAbsoluteURL()
203     {
204         return mAbsoluteURL;
205     }
206
207     public void setAbsoluteURL( String JavaDoc string )
208     {
209         mAbsoluteURL = string;
210     }
211
212     public boolean getRssUseCache()
213     {
214         return mRssUseCache;
215     }
216
217     public void setRssUseCache( boolean use )
218     {
219         mRssUseCache = use;
220     }
221
222     public int getRssCacheTime()
223     {
224         return mRssCacheTime;
225     }
226
227     public void setRssCacheTime( int cacheTime )
228     {
229         mRssCacheTime = cacheTime;
230     }
231
232     public boolean getNewUserAllowed()
233     {
234         return mNewUserAllowed;
235     }
236
237     public void setNewUserAllowed( boolean use )
238     {
239         mNewUserAllowed = use;
240     }
241
242     public List JavaDoc getAdminUsers()
243     {
244         return mAdminUsers;
245     }
246
247     /**
248      * @param _adminUsers
249      */

250     public void setAdminUsers( List JavaDoc _adminUsers )
251     {
252         mAdminUsers = _adminUsers;
253     }
254
255     /**
256      * @param ignore
257      */

258     public void addAdminUsers( String JavaDoc ignore )
259     {
260         mAdminUsers.add( ignore );
261     }
262
263     public String JavaDoc getNewUserData()
264     {
265         return mNewUserData;
266     }
267
268     /**
269      * @param str
270      */

271     public void setNewUserData( String JavaDoc str )
272     {
273         mNewUserData = str;
274     }
275
276     public String JavaDoc getNewUserThemes()
277     {
278         return mNewUserThemes;
279     }
280
281     /**
282      * @param str
283      */

284     public void setNewUserThemes( String JavaDoc str )
285     {
286         mNewUserThemes = str;
287     }
288
289     public List JavaDoc getEditorPages()
290     {
291         return mEditorPages;
292     }
293
294     /**
295      * @param _editorPages
296      */

297     public void setEditorPages( List JavaDoc _editorPages )
298     {
299         mEditorPages = _editorPages;
300     }
301
302     /**
303      * @param ignore
304      */

305     public void addEditorPages( String JavaDoc ignore )
306     {
307         mEditorPages.add( ignore );
308     }
309
310     public boolean getEnableAggregator()
311     {
312         return mEnableAggregator;
313     }
314
315     public void setEnableAggregator( boolean use )
316     {
317         mEnableAggregator = use;
318     }
319
320     public boolean getUploadEnabled()
321     {
322         return mUploadEnabled;
323     }
324
325     public void setUploadEnabled( boolean use )
326     {
327         mUploadEnabled = use;
328     }
329
330     public Float JavaDoc getUploadMaxDirMB()
331     {
332         return mUploadMaxDirMB;
333     }
334
335     public void setUploadMaxDirMB( Float JavaDoc use )
336     {
337         mUploadMaxDirMB = use;
338     }
339
340     public Float JavaDoc getUploadMaxFileMB()
341     {
342         return mUploadMaxFileMB;
343     }
344
345     public void setUploadMaxFileMB( Float JavaDoc use )
346     {
347         mUploadMaxFileMB = use;
348     }
349
350     public List JavaDoc getUploadAllow()
351     {
352         return mUploadAllow;
353     }
354
355     /**
356      * @param _uploadAllow
357      */

358     public void setUploadAllow( List JavaDoc _uploadAllow )
359     {
360         mUploadAllow = _uploadAllow;
361     }
362
363     /**
364      * @param ignore
365      */

366     public void addUploadAllow( String JavaDoc ignore )
367     {
368         mUploadAllow.add( ignore );
369     }
370
371     public List JavaDoc getUploadForbid()
372     {
373         return mUploadForbid;
374     }
375
376     /**
377      * @param _uploadForbid
378      */

379     public void setUploadForbid( List JavaDoc _uploadForbid )
380     {
381         mUploadForbid = _uploadForbid;
382     }
383
384     /**
385      * @param ignore
386      */

387     public void addUploadForbid( String JavaDoc ignore )
388     {
389         mUploadForbid.add( ignore );
390     }
391
392     public String JavaDoc getUploadDir()
393     {
394         return mUploadDir;
395     }
396
397     /**
398      * @param str
399      */

400     public void setUploadDir( String JavaDoc str )
401     {
402         mUploadDir = str;
403     }
404
405     public String JavaDoc getUploadPath()
406     {
407         return uploadPath;
408     }
409
410     /**
411      * @param str
412      */

413     public void setUploadPath( String JavaDoc str )
414     {
415         uploadPath = str;
416     }
417
418     public boolean getMemDebug()
419     {
420         return mMemDebug;
421     }
422
423     /**
424      * Set memory debugging on or off.
425      *
426      * @param memDebug The mMemDebug to set
427      */

428     public void setMemDebug( boolean memDebug )
429     {
430         mMemDebug = memDebug;
431     }
432
433     public boolean getAutoformatComments()
434     {
435         return mAutoformatComments;
436     }
437
438     /**
439      * @param value
440      */

441     public void setAutoformatComments( boolean value )
442     {
443         mAutoformatComments = value;
444     }
445
446     public boolean getEscapeCommentHtml()
447     {
448         return mEscapeCommentHtml;
449     }
450
451     /**
452      * @param value
453      */

454     public void setEscapeCommentHtml( boolean value )
455     {
456         mEscapeCommentHtml = value;
457     }
458
459     /**
460      * @return boolean
461      */

462     public boolean getEmailComments()
463     {
464         return mEmailComments;
465     }
466
467     /**
468      * Sets the emailComments.
469      *
470      * @param emailComments The emailComments to set
471      */

472     public void setEmailComments( boolean emailComments )
473     {
474         this.mEmailComments = emailComments;
475     }
476
477     /**
478      * Enable linkback.
479      *
480      * @return
481      */

482     public boolean isEnableLinkback()
483     {
484         return mEnableLinkback;
485     }
486
487     /**
488      * Enable linkback.
489      *
490      * @param b
491      */

492     public void setEnableLinkback( boolean b )
493     {
494         mEnableLinkback = b;
495     }
496
497     /**
498      * @return
499      */

500     public String JavaDoc getSiteDescription()
501     {
502         return mSiteDescription;
503     }
504
505     /**
506      * @return
507      */

508     public String JavaDoc getSiteName()
509     {
510         return mSiteName;
511     }
512
513     /**
514      * @param string
515      */

516     public void setSiteDescription( String JavaDoc string )
517     {
518         mSiteDescription = string;
519     }
520
521     /**
522      * @param string
523      */

524     public void setSiteName( String JavaDoc string )
525     {
526         mSiteName = string;
527     }
528
529     /**
530      * @return
531      */

532     public String JavaDoc getEmailAddress()
533     {
534         return mEmailAddress;
535     }
536
537     /**
538      * @param emailAddress
539      */

540     public void setEmailAddress( String JavaDoc emailAddress )
541     {
542         mEmailAddress = emailAddress;
543     }
544
545     /**
546      * @return the index directory
547      */

548     public String JavaDoc getIndexDir()
549     {
550         return mIndexDir;
551     }
552
553     /**
554      * @param indexDir new index directory
555      */

556     public void setIndexDir( String JavaDoc indexDir )
557     {
558         mIndexDir = indexDir;
559     }
560
561     public boolean getEncryptPasswords()
562     {
563         return mEncryptPasswords;
564     }
565
566     public void setEncryptPasswords( boolean use )
567     {
568         mEncryptPasswords = use;
569     }
570     
571     /**
572      * @return the algorithm for encrypting passwords
573      */

574     public String JavaDoc getAlgorithm()
575     {
576         return mAlgorithm;
577     }
578
579     /**
580      * @param algorithm, the new algorithm
581      */

582     public void setAlgorithm( String JavaDoc algorithm )
583     {
584         mAlgorithm = algorithm;
585     }
586     
587     //---------------------------------------- end requisite getters & setters
588

589     /**
590      * Convenience method for getAdminUsers.
591      *
592      * @return
593      */

594     public String JavaDoc[] adminUsersArray()
595     {
596         if ( mAdminUsers == null )
597         {
598             mAdminUsers = new ArrayList JavaDoc();
599         }
600
601         return (String JavaDoc[]) mAdminUsers.toArray( new String JavaDoc[mAdminUsers.size()] );
602     }
603
604     /**
605      * Convenience method for getEditorPages.
606      *
607      * @return
608      */

609     public String JavaDoc[] editorPagesArray()
610     {
611         if ( mEditorPages == null )
612         {
613             mEditorPages = new ArrayList JavaDoc();
614         }
615
616         return (String JavaDoc[]) mEditorPages.toArray( new String JavaDoc[mEditorPages.size()] );
617     }
618
619     /**
620      * Convenience method for getUploadAllow.
621      *
622      * @return
623      */

624     public String JavaDoc[] uploadAllowArray()
625     {
626         if ( mUploadAllow == null )
627         {
628             mUploadAllow = new ArrayList JavaDoc();
629         }
630
631         return (String JavaDoc[]) mUploadAllow.toArray( new String JavaDoc[mUploadAllow.size()] );
632     }
633
634     /**
635      * Convenience method for getUploadForbid.
636      *
637      * @return
638      */

639     public String JavaDoc[] uploadForbidArray()
640     {
641         if ( mUploadForbid == null )
642         {
643             mUploadForbid = new ArrayList JavaDoc();
644         }
645
646         return (String JavaDoc[]) mUploadForbid.toArray( new String JavaDoc[mUploadForbid.size()] );
647     }
648
649     public void updateValues( OldRollerConfig child )
650     {
651         this.mAbsoluteURL = child.getAbsoluteURL();
652         this.mRssUseCache = child.getRssUseCache();
653         this.mRssCacheTime = child.getRssCacheTime();
654         this.mNewUserAllowed = child.getNewUserAllowed();
655         this.mAdminUsers = child.getAdminUsers();
656         this.mNewUserData = child.getNewUserData();
657         this.mNewUserThemes = child.getNewUserThemes();
658         this.mEditorPages = child.getEditorPages();
659         this.mEnableAggregator = child.getEnableAggregator();
660         this.mUploadEnabled = child.getUploadEnabled();
661         this.mUploadMaxDirMB = child.getUploadMaxDirMB();
662         this.mUploadMaxFileMB = child.getUploadMaxFileMB();
663         this.mUploadAllow = child.getUploadAllow();
664         this.mUploadForbid = child.getUploadForbid();
665         this.mUploadDir = child.getUploadDir();
666         this.uploadPath = child.getUploadPath();
667         this.mMemDebug = child.getMemDebug();
668         this.mAutoformatComments = child.getAutoformatComments();
669         this.mEscapeCommentHtml = child.getEscapeCommentHtml();
670         this.mEmailComments = child.getEmailComments();
671         this.mEnableLinkback = child.isEnableLinkback();
672         this.mSiteName = child.getSiteName();
673         this.mSiteDescription = child.getSiteDescription();
674         this.mEmailAddress = child.getEmailAddress();
675         this.mIndexDir = child.getIndexDir();
676         this.mEncryptPasswords = child.getEncryptPasswords();
677         this.mAlgorithm = child.getAlgorithm();
678     }
679
680     /**
681      * nice output for debugging
682      *
683      * @return
684      */

685     public String JavaDoc toString()
686     {
687         StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
688
689         buf.append( "RollerConfig \n" );
690
691         Class JavaDoc clazz = getClass();
692
693         Field JavaDoc[] fields = clazz.getDeclaredFields();
694
695         try
696         {
697             AccessibleObject.setAccessible( fields, true );
698
699             for ( int i = 0; i < fields.length; i++ )
700             {
701                 buf.append( "\t[" + fields[i].getName() + "=" +
702                             fields[i].get( this ) + "], \n" );
703             }
704         }
705         catch ( Exception JavaDoc e )
706         {
707             // ignored!
708
}
709
710         return buf.toString();
711     }
712
713     /**
714      * Read the RollerConfig from a file, as specified by a String path.
715      *
716      * @param path
717      *
718      * @return
719      */

720     public static OldRollerConfig readConfig( String JavaDoc path )
721     {
722         InputStream JavaDoc in = null;
723
724         try
725         {
726             in = new FileInputStream JavaDoc( path );
727             return OldRollerConfig.readConfig( in );
728         }
729         catch ( Exception JavaDoc e )
730         {
731             System.out.println( "Exception reading RollerConfig: " +
732                                 e.getMessage() );
733         }
734         finally
735         {
736             try
737             {
738                 if ( in != null )
739                 {
740                     in.close();
741                 }
742             }
743
744             catch ( java.io.IOException JavaDoc ioe )
745             {
746                 System.err.println( "RollerConfig.writeConfig() unable to close InputStream" );
747             }
748         }
749
750         return new OldRollerConfig();
751     }
752
753     /**
754      * Read the RollerConfig from a file, as specified by an InputStream.
755      *
756      * @param in
757      *
758      * @return
759      *
760      * @throws RuntimeException
761      */

762     public static OldRollerConfig readConfig( InputStream JavaDoc in )
763     {
764         try
765         {
766             BeanReader reader = new BeanReader();
767             reader.setDebug(99);
768             reader.registerBeanClass( OldRollerConfig.class );
769             return (OldRollerConfig) reader.parse( in );
770         }
771
772         catch ( IOException JavaDoc e )
773         {
774             throw new RuntimeException JavaDoc( "FATAL ERROR reading RollerConfig inputstream.",
775                                         e );
776         }
777
778         catch ( SAXException JavaDoc e )
779         {
780             throw new RuntimeException JavaDoc( "FATAL ERROR parsing RollerConfig, file is corrupted?",
781                                         e );
782         }
783
784         catch ( IntrospectionException JavaDoc e )
785         {
786             throw new RuntimeException JavaDoc( "FATAL ERROR introspecting RollerConfig bean.",
787                                         e );
788         }
789     }
790
791     /**
792      * Write RollerConfig to file, as specified by a String path.
793      *
794      * @param path
795      *
796      * @throws RollerException
797      */

798     public void writeConfig( String JavaDoc path ) throws RollerException
799     {
800         FileOutputStream JavaDoc out = null;
801
802         try
803         {
804             out = new FileOutputStream JavaDoc( path );
805             writeConfig( out );
806         }
807         catch ( FileNotFoundException JavaDoc e )
808         {
809             throw new RollerException( "ERROR file not found: " + path, e );
810         }
811         finally
812         {
813             try
814             {
815                 if ( out != null )
816                 {
817                     out.close();
818                 }
819             }
820             catch ( java.io.IOException JavaDoc ioe )
821             {
822                 System.err.println( "RollerConfig.writeConfig() unable to close OutputStream" );
823             }
824         }
825     }
826
827     /**
828      * Write RollerConfig to file, as specified by an OutputStream.
829      *
830      * @param out
831      *
832      * @throws RollerException
833      */

834     public void writeConfig( OutputStream JavaDoc out ) throws RollerException
835     {
836         BeanWriter writer = new BeanWriter( out );
837         writer.enablePrettyPrint();
838         writer.setIndent( " " );
839         writer.setWriteIDs( false );
840
841         try
842         {
843             writer.write( this );
844         }
845         catch ( IOException JavaDoc e )
846         {
847             throw new RollerException( "ERROR writing to roller-config.xml stream.",
848                                        e );
849         }
850         catch ( SAXException JavaDoc e )
851         {
852             throw new RollerException( "ERROR writing to roller-config.xml stream.",
853                                        e );
854         }
855         catch ( IntrospectionException JavaDoc e )
856         {
857             throw new RollerException( "ERROR introspecting RollerConfig bean.",
858                                        e );
859         }
860     }
861
862     /**
863      * test stuff
864      *
865      * @param args
866      */

867     public static void main( String JavaDoc[] args )
868     {
869         String JavaDoc basedir = System.getProperty( "basedir" );
870         String JavaDoc path = "build/roller/WEB-INF/roller-config.xml";
871         path = new java.io.File JavaDoc( basedir, path ).getAbsolutePath();
872         if ( ( args.length > 0 ) && args[0].equals( "read" ) )
873         {
874             OldRollerConfig.readConfig( path );
875         }
876         else if ( ( args.length > 0 ) && args[0].equals( "write" ) ) // write
877
{
878             path = "build/roller/WEB-INF/roller-config-test.xml";
879             path = new java.io.File JavaDoc( basedir, path ).getAbsolutePath();
880             OldRollerConfig bean = new OldRollerConfig();
881
882             try
883             {
884                 bean.writeConfig( path );
885             }
886             catch ( Exception JavaDoc e )
887             {
888                 mLogger.error( "Unexpected exception", e );
889             }
890         }
891         else // both
892
{
893             OldRollerConfig bean = OldRollerConfig.readConfig( path );
894             path = "build/roller/WEB-INF/roller-config-test.xml";
895             path = new java.io.File JavaDoc( basedir, path ).getAbsolutePath();
896
897             try
898             {
899                 bean.writeConfig( path );
900             }
901             catch ( Exception JavaDoc e )
902             {
903                 mLogger.error( "Unexpected exception", e );
904             }
905         }
906
907         System.out.println( "RollerConfig.main completed" );
908     }
909 }
910
Popular Tags