public void load()

in commons-transfer/commons-transfer-api/src/main/java/org/apache/archiva/commons/transfer/defaults/DefaultTransferStore.java [92:130]


    public void load() throws IOException {
        if (!file.exists()) {
            return;
        }

        config.clear();

        FileReader reader = null;
        try {
            reader = new FileReader(file);
            BufferedReader buf = new BufferedReader(reader);
            String line;
            while ((line = buf.readLine()) != null) {
                if (StringUtils.isBlank(line)) {
                    // Skip blank lines.
                    continue;
                }
                line = line.trim();
                if (line.startsWith("#")) {
                    // Skip comments.
                    continue;
                }
                int idx = line.indexOf('=');
                if (idx <= 0) {
                    // Bad line, skip.
                    continue;
                }
                String key = line.substring(0, idx);
                String value = line.substring(idx + 1);
                config.put(key, value);
            }
        } catch (IOException e) {
            // Unable to load the properties.
            log.error("Unable to load the existing properties.", e);
            throw e;
        } finally {
            IOUtils.closeQuietly(reader);
        }
    }