001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 2004 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * Initial developer: Florent BENOIT
022: * Contributor: Shenheng Liang
023: * --------------------------------------------------------------------------
024: * $Id: JReplace.java 7081 2005-07-22 12:59:10Z benoitf $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas.ant.jonasbase;
027:
028: import java.io.File;
029:
030: // use class defined in this package.
031: // Should use ant class but there is a problem
032: //import org.apache.tools.ant.taskdefs.Replace;
033:
034: /**
035: * Defines common replacement methods
036: * @author Florent Benoit
037: */
038: public class JReplace extends Replace implements BaseTaskItf {
039:
040: /**
041: * configuration file used
042: */
043: private String configurationFile = null;
044:
045: /**
046: * Information for the logger
047: */
048: private String logInfo = null;
049:
050: /**
051: * JONAS_ROOT directory
052: */
053: private File jonasRoot = null;
054:
055: /**
056: * Sets the configuration file
057: * @param configurationFile The configurationFile to set.
058: */
059: public void setConfigurationFile(String configurationFile) {
060: this .configurationFile = configurationFile;
061: }
062:
063: /**
064: * @param destDir The destDir to set.
065: */
066: public void setDestDir(File destDir) {
067: setFile(new File(new File(destDir, "conf"), configurationFile));
068: }
069:
070: /**
071: * @param destFile The destination file to set.
072: */
073: public void setDestFile(File destFile) {
074: setFile(destFile);
075: }
076:
077: /**
078: * Gets logger info (to be displayed)
079: * @return logger info
080: * @see org.objectweb.jonas.ant.jonasbase.BaseTaskItf#getLogInfo()
081: */
082: public String getLogInfo() {
083: return logInfo;
084: }
085:
086: /**
087: * Set the info to be displayed by the logger
088: * @param logInfo information to be displayed
089: * @see org.objectweb.jonas.ant.jonasbase.BaseTaskItf#setLogInfo(java.lang.String)
090: */
091: public void setLogInfo(String logInfo) {
092: this .logInfo = logInfo;
093: }
094:
095: /**
096: * @param jonasRoot The jonasRoot directory
097: */
098: public void setJonasRoot(File jonasRoot) {
099: this .jonasRoot = jonasRoot;
100: }
101:
102: /**
103: * @return the jonasRoot.
104: */
105: protected File getJonasRoot() {
106: return jonasRoot;
107: }
108:
109: }
|