Java URL Load load(URL url)

Here you can find the source of load(URL url)

Description

load

License

Open Source License

Declaration

private static Properties load(URL url) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2004 IBM Corporation 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
 * //ww  w. j a  v a 2s . co  m
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

import java.io.IOException;
import java.io.InputStream;

import java.net.URL;
import java.util.*;

public class Main {
    private static Properties load(URL url) {
        Properties props = new Properties();
        try {
            InputStream is = null;
            try {
                is = url.openStream();
                props.load(is);
            } finally {
                if (is != null)
                    is.close();
            }
        } catch (IOException e) {
            // TODO consider logging here
        }
        return props;
    }
}

Related

  1. getBundle(String basename, Locale locale, ClassLoader cl, URL url)
  2. getManifestAsString(URLClassLoader cl, String jarBaseName)
  3. load(Iterable urls)
  4. load(String fileOrURL)
  5. load(URL pUrl)
  6. load(URL url)
  7. load(URL url, boolean allowCache)
  8. loadByteArray(URL url)
  9. loadFile(String url)