Changeset 4122


Ignore:
Timestamp:
Feb 4, 2008, 1:14:02 PM (15 years ago)
Author:
Nicklas Nordborg
Message:

References #913: Plug-in JAR paths should support paths relative to the plugins.dir setting in base.config

The windows problem should now be solved, but need to test it also.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/PluginDefinition.java

    r4113 r4122  
    127127    specified or if the path is null nothing is done. If the given path is
    128128    a subpath to the <code>plugins.dir</code> path the common path is replaced
    129     with <code>%plugins.dir%</code> For example:
     129    with <code>%plugins.dir%</code> and all path separator characters are
     130    converted to '/'. For example:
    130131    <pre class="code>"
    131132path          = /usr/local/base/plugins/myplugin.jar
    132133plugins.dir   = /usr/local/base/plugins
    133134relative path = %plugins.dir%/myplugin.jar
     135
     136//On windows
     137path          = c:\base\plugins\mine\myplugin.jar
     138plugins.dir   = c:\base\plugins
     139relative path = %plugins.dir%/mine/myplugin.jar
    134140</pre>
    135141
     
    146152    if (path.startsWith(pluginsDir))
    147153    {
    148       path = "%plugins.dir%" + path.substring(pluginsDir.length());
     154      path = "%plugins.dir%" + path.substring(pluginsDir.length()).
     155        replace(java.io.File.separatorChar, '/');
    149156    }
    150157    return path;
     
    166173    if (path.startsWith("%plugins.dir%"))
    167174    {
    168       path = pluginsDir + path.substring("%plugins.dir%".length());
     175      path = pluginsDir + path.substring("%plugins.dir%".length()).
     176        replace('/', java.io.File.separatorChar);
    169177    }
    170178    return path;
Note: See TracChangeset for help on using the changeset viewer.