Changeset 9ba6c29


Ignore:
Timestamp:
Aug 26, 2012 12:54:49 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b01cf32
Parents:
99681e1
Message:
  • DataHelper?: Trim trailing whitespace when loading properties
File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/data/DataHelper.java

    r99681e1 r9ba6c29  
    395395        loadProps(props, file, false);
    396396    }
     397
     398    /**
     399     *  @param forceLowerCase if true forces the keys to lower case (not the values)
     400     */
    397401    public static void loadProps(Properties props, File file, boolean forceLowerCase) throws IOException {
    398402        loadProps(props, new FileInputStream(file), forceLowerCase);
    399403    }
     404
    400405    public static void loadProps(Properties props, InputStream inStr) throws IOException {
    401406        loadProps(props, inStr, false);
    402407    }
     408
     409    /**
     410     *  @param forceLowerCase if true forces the keys to lower case (not the values)
     411     */
    403412    public static void loadProps(Properties props, InputStream inStr, boolean forceLowerCase) throws IOException {
    404413        BufferedReader in = null;
     
    415424                if (split <= 0) continue;
    416425                String key = line.substring(0, split);
    417                 String val = line.substring(split+1);   //.trim() ??????????????
     426                String val = line.substring(split+1).trim();
    418427                // Unescape line breaks after loading.
    419428                // Remember: "\" needs escaping both for regex and string.
Note: See TracChangeset for help on using the changeset viewer.