cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/environment/commandline CommandlineContext.java
Date Wed, 28 Nov 2001 01:52:56 GMT
crossley    01/11/27 17:52:56

  Modified:    src/org/apache/cocoon/environment/commandline Tag:
                        cocoon_20_branch CommandlineContext.java
  Log:
  contextDir now is the absolute pathname rather than just '.'
  PR:5060
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.7   +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.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- CommandlineContext.java	2001/10/25 19:31:25	1.1.2.6
  +++ CommandlineContext.java	2001/11/28 01:52:56	1.1.2.7
  @@ -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


Mime
View raw message