Changeset f6ec3f6


Ignore:
Timestamp:
Jul 24, 2009 3:35:58 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
27561fb
Parents:
2f0b9a8
Message:
  • Router: Support i2p.dir.base and i2p.dir.config passed in via properties
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/WorkingDir.java

    r2f0b9a8 rf6ec3f6  
    5353     * Caller should store the return value for future reference.
    5454     */
    55     public static String getWorkingDir(boolean migrateOldConfig) {
    56         String dir = System.getProperty(PROP_WORKING_DIR);
     55    public static String getWorkingDir(Properties envProps, boolean migrateOldConfig) {
     56        String dir = null;
     57        if (envProps != null)
     58            dir = envProps.getProperty(PROP_WORKING_DIR);
     59        if (dir == null)
     60            dir = System.getProperty(PROP_WORKING_DIR);
    5761        boolean isWindows = System.getProperty("os.name").startsWith("Win");
    5862        File dirf = null;
     
    7074            }
    7175        }
     76
    7277        // where we are now
    73         String cwd = System.getProperty(PROP_BASE_DIR);
    74         if (cwd == null)
    75             cwd = System.getProperty("user.dir");
     78        String cwd = null;
     79        if (envProps != null)
     80            cwd = envProps.getProperty(PROP_BASE_DIR);
     81        if (cwd == null) {
     82            cwd = System.getProperty(PROP_BASE_DIR);
     83            if (cwd == null)
     84                cwd = System.getProperty("user.dir");
     85        }
    7686
    7787        // Check for a hosts.txt file, if it exists then I2P is there
  • router/java/src/net/i2p/router/Router.java

    r2f0b9a8 rf6ec3f6  
    138138        String migrate = System.getProperty("i2p.dir.migrate");
    139139        boolean migrateFiles = Boolean.valueOf(migrate).booleanValue();
    140         String userDir = WorkingDir.getWorkingDir(migrateFiles);
     140        String userDir = WorkingDir.getWorkingDir(envProps, migrateFiles);
    141141
    142142        // Use the router.config file specified in the router.configLocation property
Note: See TracChangeset for help on using the changeset viewer.