bloritsch 02/01/10 08:01:00
Modified: src/java/org/apache/cocoon Main.java
Log:
add an option to specify the cocoon.xconf file in another location than the context
root
Revision Changes Path
1.3 +13 -2 xml-cocoon2/src/java/org/apache/cocoon/Main.java
Index: Main.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/Main.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Main.java 4 Jan 2002 09:45:36 -0000 1.2
+++ Main.java 10 Jan 2002 16:01:00 -0000 1.3
@@ -97,7 +97,7 @@
* Command line entry point.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.2 $ $Date: 2002/01/04 09:45:36 $
+ * @version CVS $Revision: 1.3 $ $Date: 2002/01/10 16:01:00 $
*/
public class Main {
@@ -117,6 +117,7 @@
protected static final int ACCEPT_OPT = 'p';
protected static final int URI_FILE = 'f';
protected static final int FOLLOW_LINKS_OPT = 'r';
+ protected static final int CONFIG_FILE = 'C';
protected static final String DEFAULT_USER_AGENT = Constants.COMPLETE_NAME;
protected static final String DEFAULT_ACCEPT = "text/html, */*";
@@ -175,6 +176,11 @@
FOLLOW_LINKS_OPT,
"process pages linked from starting page or not"
+ " (boolean argument is expected, default is
true)"),
+ new CLOptionDescriptor("configFile",
+ CLOptionDescriptor.ARGUMENT_REQUIRED,
+ CONFIG_FILE,
+ "specify alternate locatin of the configuration"
+ + "file (default is ${contextDir}/cocoon.xconf)")
};
/**
@@ -215,6 +221,7 @@
String destDir = Constants.DEFAULT_DEST_DIR;
String contextDir = Constants.DEFAULT_CONTEXT_DIR;
+ File conf = new File(contextDir, "/cocoon.xconf");
String workDir = Constants.DEFAULT_WORK_DIR;
List targets = new ArrayList();
CLArgsParser parser = new CLArgsParser(args, OPTIONS);
@@ -237,6 +244,10 @@
targets.add(NetUtils.normalize(option.getArgument()));
break;
+ case Main.CONFIG_FILE:
+ conf = new File(contextDir, option.getArgument());
+ break;
+
case Main.HELP_OPT:
printUsage();
break;
@@ -330,7 +341,7 @@
}
File work = getDir(workDir, "working");
File context = getDir(contextDir, "context");
- File conf = getConfigurationFile(context);
+ conf = getConfigurationFile(context);
DefaultContext appContext = new DefaultContext();
appContext.put(Constants.CONTEXT_CLASS_LOADER,
Main.class.getClassLoader());
CommandlineContext clContext = new CommandlineContext(contextDir);
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]