Java URL Load loadProps(URL url, Properties props)

Here you can find the source of loadProps(URL url, Properties props)

Description

load Props

License

Open Source License

Declaration

public static void loadProps(URL url, Properties props) throws Exception 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2004, 2005 Sybase, Inc. and others.
 *
 * 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
 *
 * Contributors://from  ww  w.  j av  a  2 s.co m
 *     Sybase, Inc. - initial API and implementation
 *******************************************************************************/

import java.io.InputStream;

import java.net.URL;
import java.util.Properties;

public class Main {
    public static void loadProps(URL url, Properties props) throws Exception {
        InputStream inputStream = null;
        if (url != null) {
            inputStream = url.openStream();
        } else {
            System.out.println("Props File not Found");
        }
        props.load(inputStream);
    }
}

Related

  1. loadProperties(Properties p, URL url)
  2. loadProperties(URL url)
  3. loadProperties(URL url)
  4. loadPropertiesFromFileOrURL(String propertiesFile)
  5. loadPropertiesFromURL(URL url)
  6. loadRemoteJSON(final URL source)
  7. loadText(URL url, boolean allowCache)
  8. loadURL(String urlDesc)
  9. loadURL(URL url)