You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cr...@apache.org on 2001/11/27 17:38:37 UTC
cvs commit: xml-cocoon2/src/org/apache/cocoon/environment/commandline CommandlineContext.java
crossley 01/11/27 08:38:37
Modified: src/org/apache/cocoon/environment/commandline
CommandlineContext.java
Log:
contextDir now is the absolute pathname rather than just '.'
PR:5060
Revision Changes Path
1.9 +9 -1 xml-cocoon2/src/org/apache/cocoon/environment/commandline/CommandlineContext.java
Index: CommandlineContext.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/commandline/CommandlineContext.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- CommandlineContext.java 2001/10/25 19:32:59 1.8
+++ CommandlineContext.java 2001/11/27 16:38:37 1.9
@@ -11,6 +11,7 @@
import org.apache.avalon.framework.logger.AbstractLoggable;
import org.apache.cocoon.environment.Context;
+import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
@@ -34,7 +35,14 @@
* Constructs a CommandlineContext object from a ServletContext object
*/
public CommandlineContext (String contextDir) {
- this.contextDir = contextDir;
+ String contextDirPath = new File(contextDir).getAbsolutePath();
+ if (contextDirPath.endsWith("/.")) {
+ int pos = contextDirPath.lastIndexOf("/.");
+ this.contextDir = contextDirPath.substring(0, pos);
+ }
+ else {
+ this.contextDir = contextDirPath;
+ }
this.attributes = new HashMap();
}
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org