KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > ant > jonasbase > JReplace


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2004 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * Initial developer: Florent BENOIT
22  * Contributor: Shenheng Liang
23  * --------------------------------------------------------------------------
24  * $Id: JReplace.java,v 1.7 2005/07/22 12:59:10 benoitf Exp $
25  * --------------------------------------------------------------------------
26  */

27
28 package org.objectweb.jonas.ant.jonasbase;
29
30 import java.io.File JavaDoc;
31
32 // use class defined in this package.
33
// Should use ant class but there is a problem
34
//import org.apache.tools.ant.taskdefs.Replace;
35

36 /**
37  * Defines common replacement methods
38  * @author Florent Benoit
39  */

40 public class JReplace extends Replace implements BaseTaskItf {
41
42     /**
43      * configuration file used
44      */

45     private String JavaDoc configurationFile = null;
46
47     /**
48      * Information for the logger
49      */

50     private String JavaDoc logInfo = null;
51
52     /**
53      * JONAS_ROOT directory
54      */

55     private File JavaDoc jonasRoot = null;
56
57     /**
58      * Sets the configuration file
59      * @param configurationFile The configurationFile to set.
60      */

61     public void setConfigurationFile(String JavaDoc configurationFile) {
62         this.configurationFile = configurationFile;
63     }
64
65     /**
66      * @param destDir The destDir to set.
67      */

68     public void setDestDir(File JavaDoc destDir) {
69         setFile(new File JavaDoc(new File JavaDoc(destDir, "conf"), configurationFile));
70     }
71
72     /**
73      * @param destFile The destination file to set.
74      */

75     public void setDestFile(File JavaDoc destFile) {
76         setFile(destFile);
77     }
78
79     /**
80      * Gets logger info (to be displayed)
81      * @return logger info
82      * @see org.objectweb.jonas.ant.jonasbase.BaseTaskItf#getLogInfo()
83      */

84     public String JavaDoc getLogInfo() {
85         return logInfo;
86     }
87
88     /**
89      * Set the info to be displayed by the logger
90      * @param logInfo information to be displayed
91      * @see org.objectweb.jonas.ant.jonasbase.BaseTaskItf#setLogInfo(java.lang.String)
92      */

93     public void setLogInfo(String JavaDoc logInfo) {
94         this.logInfo = logInfo;
95     }
96
97     /**
98      * @param jonasRoot The jonasRoot directory
99      */

100     public void setJonasRoot(File JavaDoc jonasRoot) {
101         this.jonasRoot = jonasRoot;
102     }
103
104     /**
105      * @return the jonasRoot.
106      */

107     protected File JavaDoc getJonasRoot() {
108         return jonasRoot;
109     }
110
111 }
Popular Tags