Java Properties Load from File load(Properties props, Collection filters, File basedir)

Here you can find the source of load(Properties props, Collection filters, File basedir)

Description

load

License

Open Source License

Declaration

public static void load(Properties props, Collection<String> filters, File basedir) throws IOException 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2011 Sonatype, Inc./*ww  w  . jav a  2  s . c o m*/
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 *   http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

import java.util.Collection;
import java.util.Properties;

public class Main {
    public static void load(Properties props, Collection<String> filters, File basedir) throws IOException {
        for (String filter : filters) {
            File propFile = new File(filter);
            if (!propFile.isAbsolute()) {
                propFile = new File(basedir, filter).getAbsoluteFile();
            }
            FileInputStream is = new FileInputStream(propFile);
            try {
                props.load(is);
            } finally {
                is.close();
            }
        }
    }
}

Related

  1. load(InputStream inputStream)
  2. load(InputStream is)
  3. load(InputStream stream)
  4. load(Map map, String fileName)
  5. load(Properties properties, String fileName)
  6. load(Properties props, File f)
  7. load(Properties props, File file)
  8. load(Properties props, String filename)
  9. load(String file)