### Eclipse Workspace Patch 1.0
#P JSPWiki
Index: src/com/ecyrd/jspwiki/WikiEngine.java
===================================================================
RCS file: /p/cvs/JSPWiki/src/com/ecyrd/jspwiki/WikiEngine.java,v
retrieving revision 1.253
diff -u -r1.253 WikiEngine.java
--- src/com/ecyrd/jspwiki/WikiEngine.java	9 Nov 2007 19:08:30 -0000	1.253
+++ src/com/ecyrd/jspwiki/WikiEngine.java	17 Jan 2008 14:53:25 -0000
@@ -117,6 +117,9 @@
     /** The name for the base URL to use in all references. */
     public static final String PROP_BASEURL      = "jspwiki.baseURL";
 
+    /** The name for the base URL to use in all references. */
+    public static final String PROP_BASEPATH      = "jspwiki.basePath";
+
     /** The name for the property which allows you to set the current reference
      *  style.  The value is {@value}.
      */
@@ -164,6 +167,14 @@
     /** Stores the base URL. */
     private String           m_baseURL;
 
+    /**
+     * Stores the path from the webapp root to the directory holding
+     * jspwiki files. For a normal installation, this is just "/".
+     * For webapps where jspwiki is being run "embedded", this will
+     * point to an appropriate subdirectory. 
+     */
+    private String m_basePath;
+
     /** Store the file path to the basic URL.  When we're not running as
         a servlet, it defaults to the user's current directory. */
     private String           m_rootPath = System.getProperty("user.dir");
@@ -484,6 +495,8 @@
         m_useUTF8        = "UTF-8".equals( TextUtil.getStringProperty( props, PROP_ENCODING, "ISO-8859-1" ) );
         m_baseURL        = TextUtil.getStringProperty( props, PROP_BASEURL, "" );
 
+        m_basePath = TextUtil.getStringProperty(props, PROP_BASEPATH, "/");
+
 
         m_beautifyTitle  = TextUtil.getBooleanProperty( props,
                                                         PROP_BEAUTIFYTITLE,
@@ -771,6 +784,18 @@
     }
 
     /**
+     *  Returns the path from the webapp root to the jspwiki files.
+     *
+     *  @since 2.6.1
+     *  @return The Base path, eg "/" or "/jspwiki_files"
+     */
+
+    public String getBasePath()
+    {
+        return m_basePath;
+    }
+
+    /**
      *  Returns the moment when this engine was started.
      *
      *  @since 2.0.15.
